
.qb-app, .qb-app * { box-sizing: border-box; }
.qb-app { --qb-cut: 10px; --gs-ink: #f8f5e6; --gs-muted: #b9c4d6; --gs-line: #2c4a6b; --gs-accent: #facc15; --gs-accent-ink: #1c1003;
  --gs-panel: #10263f; --gs-bg: #0d1a2e; --gs-chip: rgba(8, 16, 32, .92);
  position: relative; display: flex; flex-direction: column; color: #f8f5e6; font: 16px/1.4 "Segoe UI", system-ui, Arial, sans-serif;
  overflow: clip; -webkit-tap-highlight-color: transparent; }
.qb-app.qb-embedded { height: clamp(480px, calc(100svh - 110px), 900px); border: 1px solid #2c4a6b; background: #0d1a2e;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.qb-app.gs-fs { background: #0d1a2e; }
.qb-app .gs-stage, .qb-app .gs-main { min-height: 0; }
.qb-app.gs-wide .gs-stage { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.qb-app .gs-side { min-height: 0; overflow: auto; }
.qb-app .gs-main { display: flex; flex-direction: column; }
.qb-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 0 env(safe-area-inset-bottom, 0); }
.qb-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.qb-hud { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.qb-hudchip { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 8px; background: rgba(16, 38, 63, .92); border: 1px solid rgba(253, 230, 138, .3);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.qb-hudchip small { font: 700 9px/1 monospace; letter-spacing: 1.3px; color: #b9c4d6; }
.qb-hudchip b { font: 800 14px/1 monospace; color: #fff; white-space: nowrap; }
.qb-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden auto; background: #0d1a2e; color: #f8f5e6; border: 1px solid #2c4a6b;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.qb-scene { position: relative; height: clamp(130px, 22vh, 220px); }
.qb-scene[hidden] { display: none; }
.qb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.qb-place { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; pointer-events: none; }   
.qb-place:empty { display: none; }
.qb-chip { background: rgba(6, 14, 30, .72); border: 1px solid rgba(255, 255, 255, .25); padding: 4px 10px; font: 800 12.5px system-ui, sans-serif; color: #fff;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.qb-chip.flame { color: #fdba74; border-color: rgba(251, 146, 60, .6); }
.qb-plain .qb-place { position: static; padding: 8px 10px 0; }
.qb-main { position: relative; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.qb-pips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 14px; }
.qb-pip { width: clamp(22px, 7vw, 34px); height: 10px; background: rgba(255, 255, 255, .14); }
.qb-pip.now { background: #fde68a; box-shadow: 0 0 8px #fde68a; }
.qb-pip.ok { background: #4ade80; } .qb-pip.half { background: #facc15; } .qb-pip.bad { background: #f87171; }
.qb-card { --qb-cut: 14px; width: 100%; max-width: 660px; margin: 0 auto; padding: 16px 18px; background: linear-gradient(180deg, #16314f, #0f2238);
  border: 2px solid rgba(253, 230, 138, .55); text-align: center;
  clip-path: polygon(var(--qb-cut) 0, 100% 0, 100% calc(100% - var(--qb-cut)), calc(100% - var(--qb-cut)) 100%, 0 100%, 0 var(--qb-cut)); }
.qb-card.pop { animation: qbPop .3s ease-out; }
@keyframes qbPop { from { transform: translateY(10px) scale(.97); opacity: .3; } to { transform: none; opacity: 1; } }
.qb-kick { font: 800 12px system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #fde68a; }
.qb-cluetext { font: 700 clamp(18px, 2.8vw, 25px)/1.38 Georgia, 'Times New Roman', serif; color: #fff; margin: 10px 0 12px; text-wrap: balance; }
.qb-timer { height: 8px; background: rgba(0, 0, 0, .35); overflow: hidden; margin-bottom: 12px; }
.qb-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4ade80, #facc15); transform-origin: left; }
.qb-timer.low i { background: linear-gradient(90deg, #ef4444, #f97316); }
.qb-type { display: flex; gap: 8px; }
.qb-input { flex: 1; min-width: 0; border: 2px solid #fde68a; background: rgba(4, 10, 24, .75); color: #fff; padding: 11px 12px; min-height: 46px; font: 700 18px system-ui, sans-serif;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.qb-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(253, 230, 138, .35); }
.qb-gapq { font: 800 clamp(20px, 3.2vw, 28px)/1.6 Georgia, 'Times New Roman', serif; color: #fde68a; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.qb-gapin { flex: 0 1 230px; min-width: 120px; text-align: center; font: 800 20px system-ui, sans-serif; }
.qb-hintline { font: 800 18px ui-monospace, Consolas, monospace; letter-spacing: .08em; color: #fde68a; margin: 4px 0 8px; }
.qb-hints { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.qb-hint { min-height: 44px; border: 1px solid rgba(253, 230, 138, .4); background: rgba(4, 10, 24, .6); color: #fde68a; font: 700 13px system-ui, sans-serif; padding: 4px 10px; cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.qb-hint small { color: #cbd5e1; font-weight: 600; margin-left: 4px; }
.qb-hint:disabled { opacity: .35; cursor: default; }
.qb-worth { font: 700 13.5px system-ui, sans-serif; color: #bbf7d0; margin-top: 8px; }
.qb-msg { min-height: 20px; font-size: 14px; color: #fde68a; margin-top: 8px; }
.qb-go { background: linear-gradient(135deg, #facc15, #f97316); color: #1c1003; border: 0; padding: 11px 22px; min-height: 46px; font: 800 16px system-ui, sans-serif; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.qb-go:focus-visible, .qb-hint:focus-visible, .qb-topic:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.qb-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.qb-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.qb-topic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 108px; border: 2px solid rgba(253, 230, 138, .45);
  background: linear-gradient(170deg, #1d4067, #10263f); color: #fff; padding: 10px 8px; cursor: pointer; transition: transform .12s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.qb-topic:hover { transform: translateY(-2px); border-color: #fde68a; }
.qb-topic b { font: 800 clamp(14px, 2vw, 17px)/1.2 system-ui, sans-serif; }
.qb-topic span { font: 600 12px system-ui, sans-serif; color: #cbd5e1; }
.qb-topic i { font-style: normal; font: 800 11px system-ui, sans-serif; color: #1c1003; background: #fde68a; padding: 1px 6px; }
.qb-reveal { text-align: left; background: rgba(0, 0, 0, .28); padding: 10px 12px; margin-top: 10px; font-size: 14.5px; line-height: 1.45; }
.qb-reveal b.q { display: block; font: 800 19px Georgia, serif; color: #fde68a; margin-bottom: 4px; }
.qb-reveal .rule { display: block; margin-top: 6px; color: #bfdbfe; }
.qb-gain { font: 900 30px system-ui, sans-serif; color: #4ade80; }
.qb-gain.zero { color: #fca5a5; font-size: 22px; }
.qb-flame { display: inline-block; margin-left: 6px; font: 800 13px system-ui, sans-serif; color: #fdba74; }
.qb-sub { font-size: 14px; color: #fde68a; margin: 6px 0 10px; line-height: 1.45; }
.qb-card.shake { animation: qbShake .35s; }
@keyframes qbShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.qb-over { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 12px; background: rgba(4, 10, 24, .74); z-index: 5; }
.qb-over.show { display: flex; }
.qb-ocard { --qb-cut: 14px; background: linear-gradient(160deg, #1d4067, #0b1a2c); border: 2px solid #fde68a; padding: 16px 18px; max-width: 480px; width: 100%; max-height: 100%; overflow: auto; text-align: center;
  clip-path: polygon(var(--qb-cut) 0, 100% 0, 100% calc(100% - var(--qb-cut)), calc(100% - var(--qb-cut)) 100%, 0 100%, 0 var(--qb-cut)); }
.qb-title { font: 800 24px/1.25 system-ui, sans-serif; margin: 4px 0 8px; }
.qb-title.good { color: #bbf7d0; } .qb-title.bad { color: #fecaca; }
.qb-strip { display: flex; align-items: center; justify-content: center; margin: 12px 0 4px; }
.qb-strip i { flex: 0 1 22px; height: 3px; background: rgba(255, 255, 255, .25); }
.qb-sflag { flex: none; min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font: 800 13px system-ui, sans-serif;
  background: rgba(255, 255, 255, .1); color: #cbd5e1; border: 2px solid rgba(255, 255, 255, .25);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.qb-sflag.done { background: #16a34a; border-color: #4ade80; color: #fff; }
.qb-sflag.cur { background: #facc15; border-color: #fde68a; color: #1c1003; }
.qb-sflag.stop { padding: 0 8px; }
.qb-stopdone { font: 900 22px system-ui, sans-serif; color: #fca5a5; margin-top: 8px; }
.qb-next { margin-top: 12px; font: 800 17px system-ui, sans-serif; color: #fde68a; }
.qb-over .qb-topics { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.qb-over .qb-topic { min-height: 54px; flex-direction: row; justify-content: space-between; padding: 8px 14px; text-align: left; }
.qb-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.qb-fx i { position: absolute; top: -12px; width: 8px; height: 12px; animation: qbFall 1.6s ease-in forwards; }
@keyframes qbFall { to { transform: translate(var(--dx), 640px) rotate(var(--r)); opacity: 0; } }
@media (max-width: 560px) {
  .qb-main { padding: 10px 8px 14px; }
  .qb-topics { grid-template-columns: 1fr; }
  .qb-topic { min-height: 64px; flex-direction: row; justify-content: space-between; padding: 10px 14px; text-align: left; }
  .qb-card { padding: 14px 12px; }
  .qb-scene { height: clamp(110px, 17vh, 160px); }
}
@media (max-width: 420px) { .qb-app .gs-title { font-size: 13px; letter-spacing: .03em; } }
