*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#0f0f1a;--bg2:#1a1a2e;--bg3:#252540;--text:#e8e8f0;--text2:#a0a0b8;
  --accent:#7c3aed;--accent2:#a78bfa;--green:#22c55e;--red:#ef4444;--gold:#f59e0b;
  --board-light:#f0d9b5;--board-dark:#b58863;--board-border:#8b7355;
  --highlight:#7fc97f66;--lastmove:#cdd26a88;--radius:8px;--shadow:0 4px 24px rgba(0,0,0,.4);
  --font:'Segoe UI',system-ui,-apple-system,sans-serif;--mono:'Cascadia Code','Fira Code','Consolas',monospace;
}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);min-height:100vh;line-height:1.5}
#app{max-width:1400px;margin:0 auto;padding:16px 20px}
.app-header{display:flex;align-items:center;justify-content:space-between;padding:12px 0 16px;border-bottom:1px solid var(--bg3);margin-bottom:20px}
.brand{display:flex;align-items:center;gap:10px}
.logo{font-size:1.8rem;color:var(--accent2)}
.brand h1{font-size:1.5rem;font-weight:700;background:linear-gradient(135deg,var(--accent2),var(--accent));-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.tagline{font-size:.75rem;color:var(--text2);margin-left:4px}
.header-nav{display:flex;gap:16px}
.nav-link{color:var(--text2);text-decoration:none;font-size:.85rem;padding:4px 10px;border-radius:var(--radius);transition:all .2s}
.nav-link:hover{color:var(--text);background:var(--bg3)}
h2{font-size:1.1rem;font-weight:600;margin-bottom:4px}
h3{font-size:.95rem;font-weight:600;margin-bottom:4px}
.panel-header h2{color:var(--accent2);font-size:1rem;text-transform:uppercase;letter-spacing:.5px}
.panel-header p{color:var(--text2);font-size:.82rem;margin-bottom:12px}
.app-main{display:flex;flex-direction:column;gap:20px}
.review-panel{display:grid;grid-template-columns:1fr 1fr;gap:20px}
@media(max-width:900px){.review-panel{grid-template-columns:1fr}}
.board-area{display:flex;flex-direction:column;align-items:center;gap:8px}
.analysis-area{display:flex;flex-direction:column;gap:14px}
.how-section{text-align:center;padding:48px 0;border-top:1px solid var(--bg3);margin-top:20px}
.how-section h2{font-size:1.3rem;margin-bottom:24px;color:var(--accent2)}
.how-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;max-width:800px;margin:0 auto}
.how-card{background:var(--bg2);border-radius:var(--radius);padding:24px;border:1px solid var(--bg3)}
.how-num{width:36px;height:36px;border-radius:50%;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;margin:0 auto 12px}
.how-card p{color:var(--text2);font-size:.85rem}
.app-footer{text-align:center;padding:24px 0;border-top:1px solid var(--bg3);margin-top:20px;color:var(--text2);font-size:.8rem}
.app-footer .legal{font-size:.7rem;margin-top:4px;opacity:.6}
.toast-container{position:fixed;top:16px;right:16px;z-index:9999;display:flex;flex-direction:column;gap:8px}
.toast{padding:12px 20px;border-radius:var(--radius);background:var(--bg2);border:1px solid var(--bg3);box-shadow:var(--shadow);font-size:.85rem;animation:slideIn .3s ease;max-width:400px}
.toast.success{border-color:var(--green)}.toast.error{border-color:var(--red)}.toast.info{border-color:var(--accent)}
@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}
.hint{color:var(--text2);font-size:.78rem;margin-top:4px}
.games-list{max-height:240px;overflow-y:auto;margin-top:8px;display:flex;flex-direction:column;gap:4px}
.games-list .game-item{padding:8px 12px;background:var(--bg3);border-radius:4px;cursor:pointer;font-size:.82rem;transition:background .2s;display:flex;justify-content:space-between;gap:8px}
.games-list .game-item:hover{background:var(--accent);color:#fff}
.games-list .game-item .game-meta{color:var(--text2);font-size:.75rem;white-space:nowrap}
.engine-status{display:flex;align-items:center;gap:6px;font-size:.8rem;color:var(--text2)}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--text2);display:inline-block}
.status-dot.ready{background:var(--green)}.status-dot.busy{background:var(--gold);animation:pulse .8s infinite}
@keyframes pulse{50%{opacity:.4}}
@media(max-width:600px){
  #app{padding:12px}
  .app-header{flex-direction:column;gap:8px}
  .how-grid{grid-template-columns:1fr}
}
