:root { --bg:#1c140e; --panel:rgba(26,16,8,.82); --line:#5b3a1e; --text:#f3ead8; --sub:#c9b89a; --gold:#ffcf5a; --red:#ff6a3d; }
* { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; background:var(--bg); color:var(--text); font-family:"Yu Gothic UI","Meiryo",sans-serif; overflow:hidden; user-select:none; }
#bg { position:fixed; inset:0; width:100%; height:100%; z-index:-1; }
#app { display:flex; justify-content:center; align-items:flex-start; gap:20px; height:100vh; padding:12px; }
.bgl { height:calc(100vh - 24px); flex:none; }
.bgl canvas { display:block; height:100%; width:auto; border-radius:10px; box-shadow:0 10px 40px rgba(0,0,0,.6); }

#stageWrap { position:relative; height:calc(100vh - 24px); flex:none; }
.stage { perspective:1500px; height:100%; }
.stage canvas { display:block; height:100%; width:auto; border-radius:8px; box-shadow:0 10px 40px rgba(0,0,0,.6); transition:transform .5s; transform-origin:50% 100%; }
body.tilt .stage canvas { transform:rotateX(18deg); }
#overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
#overlay[hidden] { display:none; }
.ovBox { background:rgba(20,12,6,.9); border:3px solid var(--gold); border-radius:14px; padding:24px 26px; text-align:center; max-width:90%; }
.ovTitle { font-family:"Rye",Georgia,serif; color:var(--gold); font-size:34px; margin-bottom:8px; }
.ovBody { font-size:15px; margin-bottom:16px; line-height:1.7; }
.ovBody b { font-family:"Rye",Georgia,serif; color:var(--red); font-size:26px; }
.ovBody .new { color:var(--gold); }
#ovStart, .btns button { font:inherit; font-size:14px; padding:8px 12px; border-radius:8px; border:2px solid var(--line); background:#3a2716; color:var(--text); cursor:pointer; }
#ovStart:hover, .btns button:hover { border-color:var(--gold); }
#ovStart { font-size:16px; padding:10px 18px; }

#right { width:280px; flex:none; display:flex; gap:12px; align-items:flex-start; }
.miniBox { flex:none; }
#mini { display:block; width:60px; height:auto; border:1px solid var(--line); border-radius:4px; }
.cap { font-size:10px; color:var(--sub); margin:4px 0 0; width:60px; line-height:1.4; text-shadow:0 1px 2px #000; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px; flex:1; max-height:calc(100vh - 24px); overflow:auto; }
.btns { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.keys { width:100%; border-collapse:collapse; font-size:12px; }
.keys th { text-align:left; color:var(--gold); font-weight:normal; padding:2px 6px 2px 0; white-space:nowrap; vertical-align:top; }
.keys td { padding:2px 0; }
.rules { margin-top:10px; font-size:12px; }
.rules summary { cursor:pointer; color:var(--gold); }
.rules ul { padding-left:1.1em; margin:6px 0; line-height:1.55; }
.ver { margin-top:10px; font-size:12px; color:var(--sub); text-align:center; }

@media (max-width:1150px) { #right { display:none; } }
@media (max-width:800px) { .bgl { display:none; } }
