*{box-sizing:border-box}
body{margin:0;background:#111827;color:#e5e7eb;font-family:Arial,"Microsoft YaHei",sans-serif}
.shell{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) 400px}
.stage{position:relative;background:#0f172a;overflow:hidden;min-width:0}
#game{display:block;width:100%;height:100vh}
.hud{position:absolute;left:24px;right:24px;top:18px;display:grid;grid-template-columns:minmax(0,1fr) 150px minmax(0,1fr);gap:18px;align-items:start;pointer-events:none}
.fighter{display:grid;gap:8px;min-width:0}
.fighter span{font-weight:700;text-shadow:0 2px 0 #000;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fighter b{display:block;height:16px;border:2px solid #111;background:#3f1d1d}
.fighter i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#ef4444,#f59e0b);transition:width .12s ease}
.right{text-align:right}
.right i{margin-left:auto}
.round{text-align:center;background:rgba(15,23,42,.82);border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:8px;min-width:0}
.round span{display:block;color:#93c5fd;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.round strong{font-size:32px}
.panel{background:#f8fafc;color:#111827;padding:18px;overflow:auto;border-left:1px solid #cbd5e1;min-width:0}
header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px}
h1{font-size:20px;margin:0}
h2{font-size:15px;margin:0 0 12px}
nav{display:flex;gap:10px}
.panel a{color:#047857;text-decoration:none;font-weight:700}
.controls,.actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:16px}
.controls button:first-child{grid-column:1/-1}
button{min-height:42px;border:0;border-radius:6px;background:#047857;color:white;font-weight:700;cursor:pointer;padding:0 12px;min-width:0;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
button:hover{background:#065f46}
button.secondary{background:#475569}
button.secondary:hover{background:#334155}
.card{background:white;border:1px solid #e5e7eb;border-radius:8px;padding:14px;margin-bottom:14px}
.form-grid{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:12px}
label{display:grid;gap:5px;color:#475569;font-size:13px}
input{height:38px;border:1px solid #cbd5e1;border-radius:6px;padding:0 10px;font-size:14px;color:#0f172a;background:white;min-width:0}
select{height:38px;border:1px solid #cbd5e1;border-radius:6px;padding:0 10px;font-size:14px;color:#0f172a;background:white;min-width:0}
dl{display:grid;grid-template-columns:74px minmax(0,1fr);gap:8px;margin:0}
dt{color:#64748b}
dd{margin:0;word-break:break-all}
.hidden{display:none}
.matches{display:grid;gap:8px;margin-top:10px;color:#475569;font-size:13px}
.matches article,.players-state article,.combat-events article{display:grid;gap:2px;padding:8px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc}
.matches strong,.players-state strong,.combat-events strong{color:#0f172a;word-break:break-all}
.matches span,.players-state span,.combat-events span{color:#334155}
.matches small,.players-state small{color:#64748b}
.players-state,.combat-events{display:grid;gap:8px;color:#475569;font-size:13px}
.character-info{display:grid;gap:8px;color:#475569;font-size:13px}
.character-info article{border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;padding:8px}
.character-info strong{display:block;color:#0f172a;margin-bottom:4px}
.combat-events article.attack_hit{border-color:#bbf7d0;background:#f0fdf4}
.combat-events article.attack_miss{border-color:#fed7aa;background:#fff7ed}
.combat-events article.attack_blocked{border-color:#bfdbfe;background:#eff6ff}
pre{height:330px;overflow:auto;background:#0f172a;color:#d1fae5;border-radius:6px;padding:12px;font-size:12px;line-height:1.5;white-space:pre-wrap}
body.product-mode{overflow:hidden;background:#050816}
.product-mode .shell{grid-template-columns:1fr;width:100vw;max-width:100vw;overflow:hidden}
.product-mode .panel{display:none}
.product-mode .stage{min-height:100vh;width:100vw;max-width:100vw}
.product-mode #game{height:100vh}
.product-mode .hud{position:fixed;left:28px;right:28px;top:22px}
@media(max-width:900px){
  .shell{grid-template-columns:1fr}
  .panel{border-left:0}
  .hud{left:10px;right:10px;grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr);gap:10px}
  .round strong{font-size:24px}
  #game{height:58vh}
  .actions{grid-template-columns:1fr}
  .product-mode .hud{left:10px;right:auto;top:10px;width:370px;grid-template-columns:minmax(0,1fr) 86px minmax(0,1fr);gap:8px}
  .product-mode .fighter b{height:14px;width:86px;max-width:86px}
  .product-mode .right b{margin-left:auto}
  .product-mode .round{padding:6px}
  .product-mode .round strong{font-size:24px}
  .product-mode #game{height:100vh}
}
