body { margin:0; background:#10131a; color:#fff; font-family:'Courier New',Courier,monospace; display:flex; flex-direction:column; align-items:center; min-height:100vh; padding:18px 0; box-sizing:border-box; }
h1 { margin:4px 0; color:#4ade80; text-shadow:0 0 10px #22c55e; font-size:1.8rem; letter-spacing:2px; text-align:center; }
#hint { color:#fbbf24; font-size:0.82rem; text-align:center; margin-bottom:12px; padding:0 10px; }
#layout { display:flex; flex-direction:row; gap:18px; align-items:flex-start; max-width:95vw; }
#stage { position:relative; line-height:0; }
canvas#game { display:block; border:4px solid #4ade80; border-radius:6px; background:#161d2c; box-shadow:0 0 18px rgba(74,222,128,0.35); max-width:100%; height:auto; touch-action:none; }
#sidebar { width:250px; box-sizing:border-box; display:flex; flex-direction:column; gap:15px; }
.uibox { background:rgba(16,22,36,0.85); border:3px solid #4ade80; border-radius:8px; padding:14px; box-sizing:border-box; }
#panel { display:flex; flex-direction:column; align-items:center; gap:8px; }
#panel h3 { margin:0 0 2px; color:#4ade80; text-align:center; font-size:1.05rem; }
.field { display:flex; flex-direction:column; align-items:center; gap:6px; width:100%; }
.field label { font-size:0.78rem; color:#94a3b8; }
#name { background:#0b1220; border:2px solid #4ade80; color:#fff; padding:8px 12px; font-family:inherit; font-size:1rem; border-radius:4px; text-align:center; width:100%; box-sizing:border-box; outline:none; }
#name:focus { box-shadow:0 0 8px #22c55e; }
#name.needname { border-color:#f87171; box-shadow:0 0 8px #f87171; }
.diffs { display:flex; gap:6px; }
.diff { background:#16203a; color:#93c5fd; border:2px solid #3b82f6; padding:6px 12px; font-family:inherit; font-weight:bold; border-radius:4px; cursor:pointer; }
.diff.active { background:#3b82f6; color:#0b1220; box-shadow:0 0 10px #3b82f6; }
.charsel { display:flex; align-items:center; gap:10px; }
.charbtn { background:#16203a; color:#4ade80; border:2px solid #4ade80; width:34px; height:32px; font-family:inherit; font-weight:bold; border-radius:6px; cursor:pointer; }
.charbtn:hover { background:#1f2d4d; }
.charbtn[disabled] { opacity:0.45; cursor:not-allowed; }
#char-name { min-width:84px; text-align:center; font-weight:bold; font-size:1rem; text-shadow:0 0 6px currentColor; }
#panel-status { font-size:0.82rem; color:#93c5fd; min-height:1em; text-align:center; }
.btn-go { background:#4ade80; color:#06240f; border:none; padding:11px 18px; font-family:inherit; font-size:1.05rem; font-weight:bold; border-radius:6px; cursor:pointer; box-shadow:0 4px 0 #16a34a; width:100%; }
.btn-go:active { transform:translateY(3px); box-shadow:0 1px 0 #15803d; }
.rules-open-btn { background:#16203a; color:#fbbf24; border:2px solid #fbbf24; font-family:inherit; font-weight:bold; border-radius:6px; cursor:pointer; padding:8px; width:100%; }
.rules-open-btn:hover { background:#1f2d4d; }
.diff[disabled], #name[disabled], .btn-go[disabled] { opacity:0.5; cursor:not-allowed; }
#board h3 { margin:0 0 10px; color:#fbbf24; text-align:center; text-decoration:underline; }
.scrollbox { max-height:240px; overflow-y:auto; }
ol#list { list-style:none; padding:0; margin:0; font-size:0.92rem; }
#list li { display:flex; justify-content:space-between; padding:5px 0; border-bottom:1px dashed rgba(74,222,128,0.25); gap:8px; }
#list .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#list .sc { color:#4ade80; font-weight:bold; }
#controls { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:12px; width:100%; max-width:740px; box-sizing:border-box; flex-wrap:wrap; }
.pad { background:rgba(74,222,128,0.15); border:2px solid #4ade80; color:#fff; min-width:58px; height:52px; padding:0 8px; border-radius:10px; font-size:0.9rem; font-weight:bold; display:flex; align-items:center; justify-content:center; user-select:none; touch-action:none; text-align:center; }
.pad:active { background:rgba(74,222,128,0.5); }
.pad.atk { border-color:#f87171; background:rgba(248,113,113,0.16); color:#fecaca; }
.pad.atk:active { background:rgba(248,113,113,0.5); }
.pad.blk { border-color:#60a5fa; background:rgba(96,165,250,0.16); color:#bfdbfe; }
.pad.blk:active { background:rgba(96,165,250,0.5); }
.pad.fire { border-color:#fb923c; background:rgba(251,146,60,0.18); color:#fed7aa; }
.pad.fire:active { background:rgba(251,146,60,0.55); }
.pad.ult { border-color:#fde047; background:rgba(253,224,71,0.18); color:#fef9c3; }
.pad.ult:active { background:rgba(253,224,71,0.55); }
.pad.parry { border-color:#38bdf8; background:rgba(56,189,248,0.18); color:#bae6fd; }
.pad.parry:active { background:rgba(56,189,248,0.55); }
.pad.misc { border-color:#fbbf24; color:#fbbf24; min-width:50px; }
#rules-modal { position:fixed; inset:0; background:rgba(0,0,0,0.78); display:none; align-items:center; justify-content:center; z-index:1000; padding:16px; box-sizing:border-box; }
#rules-modal.open { display:flex; }
#rules-card { background:#141a28; border:3px solid #fbbf24; border-radius:12px; max-width:560px; width:100%; max-height:88vh; display:flex; flex-direction:column; box-sizing:border-box; box-shadow:0 0 34px rgba(0,0,0,0.7); overflow:hidden; }
.rules-head { position:relative; padding:14px 18px 10px; border-bottom:1px solid #243049; flex:0 0 auto; }
#rules-card h2 { margin:0; color:#fbbf24; text-align:center; text-shadow:0 0 8px rgba(251,191,36,0.5); font-size:1.25rem; letter-spacing:1px; }
.rules-x { position:absolute; top:8px; right:10px; width:30px; height:30px; background:#1f2937; color:#cbd5e1; border:1px solid #334155; border-radius:6px; font-size:1rem; cursor:pointer; line-height:1; }
.rules-x:hover { background:#334155; color:#fff; }
.rules-body { overflow-y:auto; -webkit-overflow-scrolling:touch; padding:12px 18px; display:grid; grid-template-columns:1fr 1fr; gap:4px 20px; }
.rsec { break-inside:avoid; margin-bottom:6px; }
.rsec h4 { margin:8px 0 3px; color:#fbbf24; font-size:0.82rem; text-transform:uppercase; letter-spacing:0.4px; border-bottom:1px solid #1e293b; padding-bottom:3px; }
.rsec p { margin:3px 0; font-size:0.84rem; line-height:1.45; color:#e2e8f0; }
.rsec em { color:#94a3b8; font-style:normal; }
#rules-card .k { color:#4ade80; font-weight:bold; }
#rules-card .closehint { text-align:center; color:#64748b; font-size:0.76rem; padding:9px; border-top:1px solid #243049; flex:0 0 auto; }
@media (max-width:560px){ .rules-body { grid-template-columns:1fr; } #rules-card h2 { font-size:1.1rem; } }
@media (max-width:1000px){ #layout{flex-direction:column; align-items:center;} #sidebar{width:95vw; max-width:720px;} }
