*{box-sizing:border-box}
:root{
  --bg:#070912;
  --card:rgba(13,17,30,.76);
  --card-strong:rgba(16,21,38,.92);
  --line:rgba(255,255,255,.09);
  --text:#f6f8ff;
  --muted:#8f98b3;
  --accent:#7c5cff;
  --accent2:#12d9ff;
  --good:#39e58c;
  --danger:#ff5f78;
  --warn:#ffcb66;
  --shadow:0 24px 70px rgba(0,0,0,.38);
  --radius:22px;
}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{overflow-x:hidden}
button{font:inherit}
.ambient{position:fixed;border-radius:999px;filter:blur(100px);opacity:.22;pointer-events:none;z-index:0}
.ambient-a{width:420px;height:420px;background:#5f41ff;top:-120px;left:-140px}
.ambient-b{width:520px;height:520px;background:#00b9ff;right:-190px;bottom:-180px}
body.alt .ambient-a{background:#00d8a4}
body.alt .ambient-b{background:#8a5cff}
.app-shell{position:relative;z-index:1;min-height:100vh;padding:16px}
.glass{background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.018)),var(--card);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);border:1px solid var(--line);box-shadow:var(--shadow)}
.topbar{height:72px;border-radius:20px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;margin-bottom:16px}
.brand-wrap{display:flex;align-items:center;gap:12px}
.brand-mark{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;font-weight:900;letter-spacing:-1px;background:linear-gradient(135deg,var(--accent),var(--accent2));box-shadow:0 10px 25px rgba(98,86,255,.35)}
.brand-title{font-size:16px;font-weight:800}
.brand-sub{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.14em;margin-top:2px}
.top-actions{display:flex;align-items:center;gap:10px}
.status-pill{height:36px;display:flex;align-items:center;gap:8px;padding:0 12px;border-radius:999px;background:rgba(255,255,255,.055);border:1px solid var(--line);font-size:12px;color:var(--muted)}
.status-pill.warn{color:#ffd993}
.status-pill.ok{color:#7ff5b3}
.status-dot{width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 14px currentColor}
.icon-btn{width:36px;height:36px;border:none;border-radius:12px;background:rgba(255,255,255,.055);color:var(--text);cursor:pointer;border:1px solid var(--line)}
.workspace{display:grid;grid-template-columns:210px minmax(0,1fr) 370px;gap:16px;min-height:calc(100vh - 126px)}
.sidebar,.game-area,.predict-panel{border-radius:var(--radius)}
.sidebar{padding:16px;display:flex;flex-direction:column}
.section-label,.eyebrow{font-size:10px;letter-spacing:.18em;font-weight:800;color:#78829f}
.game-card{margin-top:10px;width:100%;border:none;color:var(--text);background:linear-gradient(135deg,rgba(124,92,255,.18),rgba(18,217,255,.06));border:1px solid rgba(124,92,255,.34);border-radius:16px;padding:12px;display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer}
.game-icon{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#ff9a45,#ff4b68);display:grid;place-items:center;font-weight:900;font-size:17px}
.game-meta{display:flex;flex-direction:column;gap:2px;flex:1}
.game-meta strong{font-size:13px}.game-meta span{font-size:11px;color:var(--muted)}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 14px var(--good)}
.coming-card{margin-top:10px;padding:12px;border:1px dashed var(--line);border-radius:16px;display:flex;gap:10px;align-items:center;color:var(--muted)}
.coming-card>span{font-size:22px}.coming-card strong{display:block;font-size:12px;color:#b5bdd2}.coming-card small{font-size:10px}
.sidebar-note{margin-top:auto;padding:13px;border-radius:16px;background:rgba(57,229,140,.055);border:1px solid rgba(57,229,140,.14);display:flex;gap:10px}
.sidebar-note .shield{font-size:24px;color:var(--good)}
.sidebar-note strong{font-size:12px}.sidebar-note p{font-size:10px;color:var(--muted);line-height:1.45;margin:4px 0 0}
.game-area{padding:15px;min-width:0;display:flex;flex-direction:column}
.panel-head{height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.panel-head h1,.panel-head h2{margin:2px 0 0;font-size:18px;letter-spacing:-.02em}
.panel-head.compact{height:52px}
.panel-head-actions{display:flex;gap:8px}
.ghost-btn,.text-btn{border:1px solid var(--line);background:rgba(255,255,255,.045);color:#cbd2e4;border-radius:11px;padding:9px 11px;cursor:pointer;font-size:11px;transition:.2s}
.ghost-btn:hover,.text-btn:hover{background:rgba(255,255,255,.09);color:#fff}
.embed-wrap{position:relative;flex:1;min-height:620px;border-radius:18px;overflow:hidden;border:1px solid var(--line);background:#05070d}
.embed-toolbar{height:42px;display:flex;align-items:center;gap:12px;padding:0 12px;background:#0d101a;border-bottom:1px solid var(--line)}
.browser-dots{display:flex;gap:5px}.browser-dots i{width:7px;height:7px;border-radius:50%;background:#475069}.browser-dots i:first-child{background:#ff6b7d}.browser-dots i:nth-child(2){background:#ffce68}.browser-dots i:nth-child(3){background:#48dc8b}
.url-chip{margin:auto;background:#121725;border:1px solid var(--line);border-radius:8px;padding:5px 12px;color:#818aa3;font-size:10px;min-width:180px;text-align:center}
.embed-state{font-size:10px;color:#707a95}
#gameFrame{display:block;width:100%;height:calc(100% - 42px);min-height:578px;border:0;background:#080a10}
.frame-note{position:absolute;left:12px;right:12px;bottom:12px;padding:9px 11px;border-radius:10px;background:rgba(5,7,13,.88);border:1px solid var(--line);font-size:10px;line-height:1.4;color:#8c95ac;pointer-events:none}
.predict-panel{padding:15px;overflow:hidden}
.engine-chip{font-size:9px;font-weight:800;letter-spacing:.14em;color:#86efb3;border:1px solid rgba(57,229,140,.25);background:rgba(57,229,140,.07);border-radius:999px;padding:7px 9px}
.prediction-main{padding:8px 0 13px}
.prediction-orb{min-height:148px;border-radius:20px;border:1px solid rgba(124,92,255,.26);background:radial-gradient(circle at 50% 10%,rgba(124,92,255,.22),transparent 55%),linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.015));display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:inset 0 0 50px rgba(124,92,255,.05)}
.prediction-orb.tai{border-color:rgba(255,95,120,.34);background:radial-gradient(circle at 50% 10%,rgba(255,95,120,.22),transparent 55%),rgba(255,255,255,.02)}
.prediction-orb.xiu{border-color:rgba(18,217,255,.34);background:radial-gradient(circle at 50% 10%,rgba(18,217,255,.20),transparent 55%),rgba(255,255,255,.02)}
.prediction-kicker{font-size:9px;letter-spacing:.2em;color:#808aa5;font-weight:800}
.prediction-orb strong{font-size:42px;line-height:1;margin:9px 0 7px;letter-spacing:-.04em}
.prediction-orb small{color:var(--muted);font-size:11px}
.probability-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.prob-card{padding:11px;border-radius:14px;background:rgba(255,255,255,.032);border:1px solid var(--line)}
.prob-top{display:flex;justify-content:space-between;font-size:11px}.prob-top strong{font-size:12px}
.meter{height:5px;background:#1a2030;border-radius:999px;margin-top:9px;overflow:hidden}.meter span{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .35s ease}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:4px 0 14px}
.stat{padding:10px 7px;border-radius:13px;border:1px solid var(--line);background:rgba(255,255,255,.025);text-align:center}
.stat span{display:block;font-size:9px;color:var(--muted);margin-bottom:4px}.stat strong{font-size:13px}
.history-block{padding:12px;border-radius:16px;background:rgba(255,255,255,.025);border:1px solid var(--line)}
.block-head{display:flex;justify-content:space-between;align-items:center}.block-head small{font-size:9px;color:var(--muted)}
.text-btn{padding:7px 9px}
.history-row{display:flex;gap:7px;overflow:auto;padding-top:11px;min-height:42px;scrollbar-width:none}.history-row::-webkit-scrollbar{display:none}
.history-chip{min-width:28px;height:28px;border-radius:9px;display:grid;place-items:center;font-size:10px;font-weight:900;border:1px solid var(--line)}
.history-chip.tai{background:rgba(255,95,120,.12);color:#ff8da0;border-color:rgba(255,95,120,.2)}
.history-chip.xiu{background:rgba(18,217,255,.10);color:#72e8ff;border-color:rgba(18,217,255,.2)}
.empty-history{font-size:10px;color:#626c85;margin:auto 0}
.manual-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.result-btn{height:48px;border-radius:14px;border:1px solid var(--line);color:#fff;font-weight:900;cursor:pointer;transition:.18s}
.result-btn:hover{transform:translateY(-1px)}
.result-btn.tai{background:linear-gradient(135deg,#ff5f78,#ff7e59);box-shadow:0 12px 28px rgba(255,95,120,.16)}
.result-btn.xiu{background:linear-gradient(135deg,#1abff0,#5d7cff);box-shadow:0 12px 28px rgba(18,217,255,.12)}
.micro-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.wide{width:100%}.danger{color:#ff8ca0}
.api-box{display:flex;gap:11px;padding:12px;margin-top:12px;border-radius:15px;background:rgba(124,92,255,.055);border:1px solid rgba(124,92,255,.15)}
.api-icon{font-size:25px;color:#9c8aff}.api-box strong{font-size:11px}.api-box p{margin:4px 0 0;font-size:9.5px;line-height:1.45;color:var(--muted)}code{color:#a99cff}
.footer{min-height:38px;display:flex;align-items:center;justify-content:center;gap:8px;color:#69728b;font-size:10px;padding-top:10px;text-align:center;flex-wrap:wrap}
.toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#121724;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:10px 14px;font-size:11px;color:#dfe5f5;transition:.25s;z-index:99}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (max-width:1180px){
  .workspace{grid-template-columns:82px minmax(0,1fr) 340px}
  .sidebar{padding:12px}
  .section-label,.game-meta,.coming-card div,.sidebar-note div{display:none}
  .game-card{justify-content:center;padding:9px}.live-dot{position:absolute;margin:0 0 29px 29px}.game-card{position:relative}
  .coming-card{justify-content:center}.sidebar-note{justify-content:center}.sidebar-note .shield{font-size:22px}
}
@media (max-width:920px){
  .app-shell{padding:10px}
  .topbar{height:62px;margin-bottom:10px;border-radius:16px}
  .brand-sub{display:none}
  .status-pill{font-size:10px}
  .workspace{display:flex;flex-direction:column;min-height:auto;gap:10px}
  .sidebar{order:1;min-height:66px;flex-direction:row;align-items:center;gap:8px;border-radius:16px}
  .sidebar>.section-label,.sidebar-note{display:none}.game-card{width:auto;margin:0}.coming-card{margin:0;width:auto}
  .game-meta,.coming-card div{display:flex}.game-meta{min-width:100px}.coming-card div{flex-direction:column}
  .game-area{order:2;border-radius:16px;padding:10px}
  .predict-panel{order:3;border-radius:16px}
  .embed-wrap{min-height:58vh}.embed-toolbar{height:38px}#gameFrame{min-height:calc(58vh - 38px)}
}
@media (max-width:600px){
  .topbar{padding:0 12px}.brand-mark{width:36px;height:36px;border-radius:11px}.brand-title{font-size:14px}
  .icon-btn{display:none}.status-pill{padding:0 9px}
  .panel-head{height:auto;min-height:54px;align-items:center}.panel-head h1{font-size:16px}
  .panel-head-actions{gap:5px}.panel-head-actions .ghost-btn{font-size:0;padding:9px}.panel-head-actions .ghost-btn:first-child:after{content:"↻";font-size:15px}.panel-head-actions .ghost-btn:last-child:after{content:"⛶";font-size:15px}
  .embed-wrap{min-height:52vh}.url-chip{min-width:0;max-width:160px;overflow:hidden;text-overflow:ellipsis}.frame-note{font-size:9px}
  .predict-panel{padding:12px}.prediction-orb{min-height:132px}.prediction-orb strong{font-size:38px}
  .stats-grid{grid-template-columns:1fr 1fr}.manual-controls{position:sticky;bottom:8px;z-index:5;padding-top:4px}
  .result-btn{height:52px}.footer{font-size:9px;padding:10px 8px 2px}
}
