:root{
  --bg:#0b0f14;
  --panel:#111824;
  --panel2:#0f1621;
  --text:#eaf1ff;
  --muted:#b6c2da;
  --border: rgba(255,255,255,.12);
  --accent:#6F8F63;
  --pink:#E48BB7;
  --good:#2dbf6d;
  --bad:#e34b4b;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 20% 10%, rgba(111,143,99,.18), transparent 60%),
              radial-gradient(1000px 700px at 80% 30%, rgba(228,139,183,.14), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  position:sticky;
  top:0;
  z-index:10;
}

.brand{ display:flex; gap:12px; align-items:center; }
.brand-mark{
  width:42px; height:42px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  font-size:22px;
}
.brand-title{ font-weight:800; letter-spacing:.2px; }
.brand-subtitle{ color:var(--muted); font-size:12.5px; margin-top:2px; }

.top-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.layout{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:16px;
  padding:18px;
  max-width: 1300px;
  margin:0 auto;
}

.panel{
  border:1px solid var(--border);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.panel-left{ padding:16px 16px 14px; }
.panel-left h2{ margin:0 0 10px; font-size:18px; }

.panel-main{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height: 70vh;
}

.control-group{ margin-top:14px; padding-top:14px; border-top:1px dashed rgba(255,255,255,.12); }
.control-group:first-of-type{ border-top:none; padding-top:0; }
.label{ display:block; color:var(--muted); font-size:12.5px; margin-bottom:8px; }
.select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.35);
  color:var(--text);
  outline:none;
}

.seg{ display:flex; gap:8px; flex-wrap:wrap; }
.seg-btn{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color:var(--text);
  cursor:pointer;
  font-size:12.5px;
}
.seg-btn.is-active{ border-color: rgba(111,143,99,.65); box-shadow: 0 0 0 3px rgba(111,143,99,.18); }

.row{ display:flex; gap:10px; flex-wrap:wrap; }

.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color:var(--text);
  cursor:pointer;
  font-weight:600;
}
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn-primary{
  background: linear-gradient(135deg, rgba(111,143,99,.85), rgba(111,143,99,.55));
  border-color: rgba(111,143,99,.75);
}
.btn-good{
  background: linear-gradient(135deg, rgba(45,191,109,.9), rgba(45,191,109,.55));
  border-color: rgba(45,191,109,.75);
}
.btn-bad{
  background: linear-gradient(135deg, rgba(227,75,75,.95), rgba(227,75,75,.55));
  border-color: rgba(227,75,75,.75);
}
.btn-ghost{
  background: rgba(255,255,255,.04);
}

.file-label{ position:relative; overflow:hidden; }
.file-label input{
  position:absolute;
  left:-9999px;
}

.timer-row{
  margin-top:8px;
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
.timer-display{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  min-width: 68px;
  text-align:center;
  font-weight:800;
}

.score-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.score-box{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background: rgba(0,0,0,.2);
}
.score-label{ color:var(--muted); font-size:12px; }
.score-value{ font-size:22px; font-weight:900; margin-top:4px; }

.hint{ color:var(--muted); font-size:12px; margin-top:8px; line-height:1.35; }

.wedges{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.wedge{
  padding:10px 10px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  position:relative;
  overflow:hidden;
  min-height: 58px;
}
.wedge::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width:8px;
  background: var(--wedge-color, #888);
}
.wedge-title{ font-weight:800; font-size:12.5px; line-height:1.1; }
.wedge-status{ margin-top:6px; color:var(--muted); font-size:12px; }
.wedge.is-earned{ border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.06); }
.wedge.is-earned .wedge-status{ color: rgba(45,191,109,.95); font-weight:800; }

.card{
  border:1px solid var(--border);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  padding:18px;
  box-shadow: var(--shadow);
  min-height: 360px;
}
.card-top{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-bottom:10px;
}
.pill{
  padding:7px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  font-weight:800;
  font-size:12px;
}
.pill-outline{
  background: rgba(0,0,0,.18);
}
.qtext{ margin:10px 0 0; font-size:26px; line-height:1.15; }
.answer-wrap{ margin-top:18px; }
.answer-label{ color:var(--muted); font-size:12.5px; margin-bottom:8px; }
.atext{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  font-size:15px;
  line-height:1.35;
}
.is-hidden{ display:none; }

.toast{
  margin-top:14px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.35);
  color:var(--text);
}
.footer-note{ color:var(--muted); font-size:12.5px; }

.check{ display:flex; gap:10px; align-items:center; color:var(--text); font-size:13px; margin-top:10px; }
.settings{ padding:6px 0 0; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
}
