/* TECNO UNIVERSITY — v6 redesign (light aurora + clean glass) */
:root{
  --top-h:56px;
  --top-h-mobile:48px;

  --bg0:#f7fbff;
  --bg1:#eef6ff;
  --bg2:#f6f0ff;
  --card:rgba(255,255,255,0.72);
  --card2:rgba(255,255,255,0.86);
  --stroke:rgba(15,40,70,0.10);
  --shadow: 0 18px 55px rgba(10,30,60,0.14);
  --text:#0b1220;
  --muted:rgba(11,18,32,0.62);
  --accent:#00b8ff;      /* TECNO-ish cyan */
  --accent2:#6b5cff;     /* violet */
  --danger:#ff3d6b;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 12% 10%, rgba(0,184,255,0.22), transparent 60%),
    radial-gradient(850px 620px at 88% 20%, rgba(107,92,255,0.18), transparent 55%),
    radial-gradient(1100px 700px at 55% 110%, rgba(0,184,255,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 55%, var(--bg2));
  overflow-x:hidden;
}

/* Subtle animated aurora layer */
.bg{
  position:fixed; inset:-20%;
  background:
    radial-gradient(700px 420px at 18% 22%, rgba(0,184,255,0.18), transparent 60%),
    radial-gradient(720px 520px at 78% 28%, rgba(107,92,255,0.16), transparent 62%),
    radial-gradient(900px 650px at 52% 78%, rgba(0,184,255,0.10), transparent 60%);
  filter: blur(30px);
  opacity:0.85;
  pointer-events:none;
  animation: floaty 10s ease-in-out infinite alternate;
}
@keyframes floaty{
  from{transform: translate3d(-10px,-6px,0) scale(1);}
  to{transform: translate3d(10px,8px,0) scale(1.02);}
}

.wrap, .shell{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px 16px;
}
.shell.wide{padding:86px 16px 44px;}

.card{
  width:min(980px, 100%);
  border-radius:26px;
  background:linear-gradient(180deg, var(--card), rgba(255,255,255,0.55));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding:22px;
}

h1{margin:0 0 8px;font-size:28px;letter-spacing:0.2px;}
.sub{margin:0 0 16px;color:var(--muted);line-height:1.35;}

.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:10px;
}
.brand img.logo{
  height:96px;
  width:auto;
  max-width:min(92vw, 420px);
  object-fit:contain;
  filter: drop-shadow(0 14px 26px rgba(10,30,60,0.16));
}

/* Inputs */
label.lbl, label{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin:10px 0 6px;
}
input.inp, input, textarea, select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(15,40,70,0.14);
  background:rgba(255,255,255,0.85);
  color:var(--text);
  outline:none;
}
input:focus, input.inp:focus, textarea:focus, select:focus{
  border-color: rgba(0,184,255,0.55);
  box-shadow: 0 0 0 4px rgba(0,184,255,0.14);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(15,40,70,0.12);
  background:
    linear-gradient(135deg, rgba(0,184,255,0.95), rgba(107,92,255,0.92));
  /* По запросу: белые надписи → чёрные */
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  user-select:none;
  text-decoration:none;
  box-shadow: 0 10px 26px rgba(0,90,150,0.18);
  transform: translateZ(0);
  transition: filter .2s ease, box-shadow .2s ease;
}
.btn:hover{filter: brightness(1.02)}
.btn:active{filter: brightness(0.98)}
.btn.secondary{
  background: rgba(255,255,255,0.85);
  color: var(--text);
  border-color: rgba(15,40,70,0.12);
  box-shadow: 0 10px 26px rgba(10,30,60,0.10);
}
.btn.ghost{
  background: rgba(255,255,255,0.55);
  color: var(--text);
  border-color: rgba(15,40,70,0.10);
  box-shadow: none;
}
.btn.danger{
  background: rgba(255,61,107,0.92);
  border-color: rgba(255,61,107,0.30);
}
.btn.small{padding:9px 10px;border-radius:12px;font-weight:800;}

.muted{color:var(--muted);}
.err, .error{color:var(--danger);margin-top:10px;white-space:pre-wrap;display:none;}

.row{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;}
.row > div{flex:1;}
.row > input{flex:1;min-width:0;}
.row-between{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:14px;flex-wrap:wrap;}
.link{color:rgba(0,110,200,0.95);text-decoration:none;font-weight:800;}
.link:hover{text-decoration:underline;}

/* ===== Fixed header (Hub/Admin) ===== */
.top{
  position:fixed; top:0; left:0; right:0;
  z-index:20;
  height: var(--top-h);
  padding:0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.60));
  border-bottom:1px solid rgba(15,40,70,0.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.top .brand{
  margin:0;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.top .brand img{display:block;}
.logo.small{
  height:34px;
  width:auto;
  max-width: 240px;
  object-fit:contain;
  filter: drop-shadow(0 8px 18px rgba(10,30,60,0.12));
}
.top-title{
  font-weight:900;
  color:var(--text);
  font-size:14px;
  letter-spacing:0.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.icon-btn{
  width:38px;
  height:38px;
  border-radius:14px;
  border:1px solid rgba(15,40,70,0.12);
  background: rgba(255,255,255,0.70);
  box-shadow: 0 10px 24px rgba(10,30,60,0.10);
  display:grid;
  place-items:center;
  cursor:pointer;
  user-select:none;
}
.icon-btn:active{transform: translateY(1px);}
.icon-dots{
  width:4px;height:4px;border-radius:999px;
  background: rgba(15,40,70,0.75);
  position:relative;
}
.icon-dots::before,.icon-dots::after{
  content:"";
  width:4px;height:4px;border-radius:999px;
  background: rgba(15,40,70,0.75);
  position:absolute; left:0;
}
.icon-dots::before{ top:-7px; }
.icon-dots::after{ top:7px; }

.menu{
  position:absolute;
  top:54px;
  right:10px;
  min-width: 220px;
  padding:8px;
  border-radius:16px;
  border:1px solid rgba(15,40,70,0.12);
  background: rgba(255,255,255,0.82);
  box-shadow: 0 20px 50px rgba(10,30,60,0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.menu-user{
  padding:10px 10px 8px;
  font-size:12px;
  color:var(--muted);
  line-height:1.25;
}
.menu-sep{
  height:1px;
  background: rgba(15,40,70,0.10);
  margin:6px 8px;
}
.menu-item{
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:12px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-weight:900;
  color: var(--text);
}
.menu-item:hover{background: rgba(120,170,230,0.16);}
.menu-item.danger{color: rgba(200,30,60,0.92);}
.menu-item.danger:hover{background: rgba(220,40,70,0.10);}

/* Mobile header: ultra-compact */
@media (max-width: 520px){
  /* Force fixed, small header height */
  .top{height: var(--top-h-mobile); padding:0 8px;}
  .logo.small{height:20px; max-width: 60vw; filter:none;}
  .icon-btn{width:24px; height:24px; border-radius:10px;}
  /* Keep content below the fixed header */
  .shell.wide{padding-top: calc(var(--top-h-mobile) + 18px);} 
  .menu{top: calc(var(--top-h-mobile) + 6px); right:8px; min-width: 200px;}
  .top-title{display:none;}
}

@media (max-width: 380px){
  .top{height: 44px; padding:0 8px;}
  .logo.small{height:18px; max-width: 64vw;}
  .icon-btn{width:24px; height:24px; border-radius:10px;}
  .shell.wide{padding-top: 62px;}
  .menu{top: 50px;}
}

/* ===== Projects (Hub) ===== */
.projects{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:14px;
}
.proj{
  border-radius:22px;
  border:1px solid rgba(15,40,70,0.10);
  background:linear-gradient(180deg, var(--card2), rgba(255,255,255,0.62));
  padding:18px;
  min-height:150px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  box-shadow: 0 10px 28px rgba(10,30,60,0.10);
}
.proj-title{font-size:18px;font-weight:900;margin-bottom:6px;}
.proj-sub{color:var(--muted);font-size:13px;line-height:1.35;}

.proj-test-tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:10px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(0,110,200,0.18);
  background:rgba(0,110,200,0.08);
  color:rgba(11,18,32,0.85);
  font-size:12px;
  font-weight:900;
  letter-spacing:0.06em;
  text-transform:uppercase;
}

/* ===== Admin Tables / Panels ===== */
.panel{
  background:linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.58));
  border:1px solid rgba(15,40,70,0.10);
  border-radius:20px;
  padding:16px;
}
.table-wrap{overflow:auto;border-radius:16px;border:1px solid rgba(15,40,70,0.10);background:rgba(255,255,255,0.55);}
table{width:100%;border-collapse:collapse;}
th,td{padding:10px 8px;border-bottom:1px solid rgba(15,40,70,0.08);text-align:left;font-size:13px;}
th{color:rgba(11,18,32,0.84);font-weight:900;}

.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.footerLinks{margin-top:14px;display:flex;gap:12px;flex-wrap:wrap;}
.footerLinks a{color:rgba(0,110,200,0.95);text-decoration:none;font-weight:800;}
.footerLinks a:hover{text-decoration:underline;}

/* ===== Tabs ===== */
.tabs{display:flex;gap:10px;margin-bottom:14px;flex-wrap:wrap;}
.tabbtn{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,40,70,0.10);
  background:rgba(255,255,255,0.60);
  color:var(--muted);
  cursor:pointer;
  font-weight:900;
}
.tabbtn.active{
  color: var(--text);
  border-color: rgba(0,184,255,0.30);
  background: rgba(0,184,255,0.16);
}

/* ===== Modal ===== */
.modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:18px;}
.modal-backdrop{position:absolute;inset:0;background:rgba(10,20,40,0.45);}
.modal-card{
  position:relative;
  width:min(520px, 100%);
  border-radius:22px;
  background:linear-gradient(180deg, var(--card2), rgba(255,255,255,0.62));
  border:1px solid rgba(15,40,70,0.10);
  box-shadow: 0 18px 60px rgba(10,30,60,0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding:18px;
}
.modal-title{font-size:18px;font-weight:950;margin-bottom:6px;}
.modal-sub{color:var(--muted);font-size:13px;line-height:1.35;margin-bottom:10px;}

/* Multi-select */
.ms{ border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:10px; background:rgba(0,0,0,0.12); }
.ms-head{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.ms-search{ flex:1; min-width:160px; padding:10px 12px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background:rgba(0,0,0,0.18); color:inherit; }
.ms-actions{ display:flex; gap:8px; }
.ms-list{ max-height:240px; overflow:auto; display:flex; flex-direction:column; gap:6px; padding-right:6px; }
.ms-item{ display:flex; gap:8px; align-items:center; padding:6px 8px; border-radius:10px; border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.03); cursor:pointer; }
.ms-item input{ transform: translateY(1px); }
.ms-id{ margin-left:auto; opacity:0.55; font-size:12px; }


/* Debug log box (admin settings) */
.logbox{
  margin:0;
  padding:12px 14px;
  border:1px solid var(--stroke);
  border-radius:16px;
  background:rgba(11,18,32,0.03);
  color:rgba(11,18,32,0.86);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:12px;
  line-height:1.35;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:320px;
  overflow:auto;
}

/* --- TECNO QUIZ additions --- */
.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:999px;
  background:rgba(255,255,255,0.75);
  border:1px solid rgba(15,40,70,0.10);
  font-weight:800;
}
.hr{height:1px;background:rgba(15,40,70,0.10);margin:14px 0;}
.error{color:var(--danger);white-space:pre-wrap;margin-top:10px;display:none;}
.small{font-size:12px;color:var(--muted);}

.choiceImg{width:100%;max-height:220px;object-fit:contain;border-radius:14px;margin-top:10px;background:rgba(255,255,255,.06);}
.qImg{width:100%;max-height:280px;object-fit:contain;border-radius:16px;margin:10px 0 14px;background:rgba(255,255,255,.06);}

/* Small preset chips (time/points) */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  cursor:pointer;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(15,40,70,0.12);
  background:rgba(255,255,255,0.70);
  color:var(--text);
  font-size:12px;
  line-height:1;
}
.chip:hover{background:rgba(255,255,255,0.86)}
.chip.active{background:rgba(0,184,255,0.18);border-color:rgba(0,184,255,0.40)}

/* Admin preview */
.previewWrap{border:1px solid rgba(15,40,70,0.12);background:rgba(255,255,255,0.62);border-radius:18px;padding:14px;overflow:hidden}
.prevTop{display:flex;gap:12px;align-items:flex-start}
.prevQ{font-size:18px;font-weight:800;letter-spacing:.2px}
.prevMeta{margin-left:auto;display:flex;gap:8px;align-items:center}
.badge{padding:6px 10px;border-radius:999px;background:rgba(255,255,255,0.78);border:1px solid rgba(15,40,70,0.12);font-size:12px;color:var(--text)}
.prevImg{width:100%;max-height:240px;object-fit:contain;border-radius:14px;margin:10px 0;background:rgba(0,0,0,.15)}
.prevAnswers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.prevAns{border:1px solid rgba(15,40,70,0.12);background:rgba(255,255,255,0.72);border-radius:16px;padding:12px;display:flex;gap:10px;align-items:center;min-height:60px}
.prevAns strong{font-size:14px}
.prevAns img{width:44px;height:44px;object-fit:cover;border-radius:12px;background:rgba(0,0,0,.2)}
.prevAns.ok{border-color:rgba(92,214,135,.45);background:rgba(92,214,135,.12)}

/* Drag handles */
.dragHandle{cursor:grab;user-select:none;opacity:.75}
.dragHandle:active{cursor:grabbing}

/* Motion is handled by GSAP (transform/opacity only) */
.choice{animation:none}
.choice.selected{outline:2px solid rgba(0,170,255,.9)}
.choice.wrong{animation:none}

.choiceText{font-weight:700;font-size:16px;line-height:1.2}
@media (max-width:520px){.choiceText{font-size:15px}}

.choice.selected{outline:2px solid rgba(0,170,255,.9)}

/* Timer ring */
.ring{display:block}
.tlabel{font-weight:900;min-width:24px;text-align:right}

/* Feedback overlay (✓ / ✕) */
.fxLayer{
  position:fixed;inset:0;display:grid;place-items:center;
  opacity:0;pointer-events:none;z-index:999;
}
.fxBadge{
  width:min(320px, 86vw);
  border-radius:22px;
  border:1px solid rgba(15,40,70,0.12);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 24px 70px rgba(10,30,60,0.20);
  backdrop-filter: blur(18px);
  display:flex;gap:14px;align-items:center;justify-content:center;
  padding:16px 18px;
;
  position:relative
}
.fxTitle{font-weight:1000;letter-spacing:.2px;font-size:18px;color:var(--text)}
.fxLayer.good .fxBadge{border-color:rgba(0,184,255,0.28)}
.fxLayer.bad .fxBadge{border-color:rgba(255,61,107,0.28)}

@media (prefers-reduced-motion: reduce){
  .fxLayer{display:none}
}


/* Lottie badge container */
.fxLottie{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;}
.fxLottie > svg{width:100%;height:100%;}
#fxLayer.good .fxLottie{opacity:1;}
#fxLayer.bad .fxLottie{opacity:1;}
#fxLayer.time .fxLottie{opacity:1;}

.fxIcon{position:relative;width:52px;height:52px;flex:0 0 52px}
.fxIcon > svg{position:absolute;inset:0}
.fxIcon .fxLottie{position:absolute;inset:0;pointer-events:none}


textarea{min-height:96px;resize:vertical;}

select{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  padding-right:42px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2720%27%20height%3D%2720%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20fill%3D%27%231a2b3b%27%20d%3D%27M5.25%207.5l4.75%205%204.75-5%27/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:16px 16px;
}

/* Question set pills (admin/questions) */
.setPills{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.setPill{
  appearance:none;
  border:1px solid rgba(15,40,70,0.12);
  background:rgba(255,255,255,0.70);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
  transition:transform .18s ease, background .18s ease, border-color .18s ease;
}
.setPill:hover{transform:translateY(-1px);border-color:rgba(0,184,255,0.35)}
.setPill.active{
  background:linear-gradient(135deg, rgba(0,184,255,0.45), rgba(107,92,255,0.18));
  border-color:rgba(0,184,255,0.40);
  color:var(--text);
}

/* Tables */
.tqTable{width:100%;border-collapse:separate;border-spacing:0 10px}
.tqTable thead th{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted);text-align:left;padding:0 12px}
.tqTable tbody tr{background:rgba(255,255,255,0.70);border:1px solid rgba(15,40,70,0.12)}
.tqTable tbody td{padding:12px;border-top:1px solid rgba(15,40,70,0.08);border-bottom:1px solid rgba(15,40,70,0.08)}
.tqTable tbody tr td:first-child{border-left:1px solid rgba(15,40,70,0.08);border-top-left-radius:14px;border-bottom-left-radius:14px}
.tqTable tbody tr td:last-child{border-right:1px solid rgba(15,40,70,0.08);border-top-right-radius:14px;border-bottom-right-radius:14px}

@media(max-width:720px){
  .tqTable thead{display:none}
  .tqTable tbody tr{display:block;padding:10px;border-radius:16px}
  .tqTable tbody td{display:flex;justify-content:space-between;gap:10px;border:none;padding:8px 10px}
  .tqTable tbody tr td:first-child,.tqTable tbody tr td:last-child{border:none;border-radius:0}
  .tqTable tbody td::before{content:attr(data-label);color:var(--muted);font-size:12px}
}

/* Host stats drilldown */
.tqTable tr.clickRow, .tqTable tr.playerRow{cursor:pointer;}
.tqTable tr.clickRow:hover, .tqTable tr.playerRow:hover{background:rgba(90,120,255,0.08);}


/* Shared QR image sizing */
.qr-img{
  width:320px;
  height:320px;
  max-width:78vw;
  max-height:78vw;
}
