* { margin:0; padding:0; box-sizing:border-box; }
body { background:#141b26; color:#eee; font-family:'Segoe UI',sans-serif; display:flex; justify-content:center; }
#app { position:relative; width:960px; height:620px; }
canvas { display:block; border-radius:12px; }
.panel { position:absolute; top:10px; width:200px; background:rgba(20,28,40,.85); border:2px solid #3a4a63; border-radius:10px; padding:10px 12px; font-size:13px; line-height:1.5; }
#p0panel { left:10px; } #p1panel { right:10px; }
.panel.active { border-color:#ffd166; box-shadow:0 0 12px rgba(255,209,102,.4); }
#dicebox { position:absolute; top:12px; left:50%; transform:translateX(-50%); background:rgba(20,28,40,.85); border-radius:10px; padding:8px 18px; font-size:20px; font-weight:bold; }
#msg { position:absolute; bottom:64px; left:50%; transform:translateX(-50%); font-size:15px; color:#ffd166; text-shadow:0 1px 3px #000; white-space:nowrap; }
#controls { position:absolute; bottom:16px; left:50%; transform:translateX(-50%); display:flex; gap:10px; }
button { background:#ffd166; color:#222; border:none; border-radius:8px; padding:10px 20px; font-size:15px; font-weight:bold; cursor:pointer; }
button:hover { background:#ffe08a; }
#btnBuy { background:#69db7c; } #btnPass { background:#ced4da; }
.hidden { display:none !important; }
#log { position:absolute; bottom:14px; left:12px; width:250px; font-size:11px; color:#aab; line-height:1.5; }
#overlay { position:absolute; inset:0; background:rgba(0,0,0,.72); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; border-radius:12px; }
#overText { font-size:32px; font-weight:bold; color:#ffd166; text-align:center; line-height:1.6; }
#diceRoll { position:absolute; top:70px; left:50%; transform:translateX(-50%); display:flex; gap:26px; perspective:600px; z-index:5; }
#diceRoll .die { width:48px; height:48px; position:relative; transform-style:preserve-3d; transition:transform .35s ease-out; }
#diceRoll .die.spin { animation:tumble .65s linear; }
#diceRoll .face { position:absolute; inset:0; background:#fffbe6; color:#222; border:2px solid #cbb; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:36px; line-height:1; backface-visibility:hidden; }
#diceRoll .f1 { transform:translateZ(24px); }
#diceRoll .f2 { transform:rotateX(90deg) translateZ(24px); }
#diceRoll .f3 { transform:rotateY(90deg) translateZ(24px); }
#diceRoll .f4 { transform:rotateY(-90deg) translateZ(24px); }
#diceRoll .f5 { transform:rotateX(-90deg) translateZ(24px); }
#diceRoll .f6 { transform:rotateY(180deg) translateZ(24px); }
@keyframes tumble { from { transform:rotateX(0deg) rotateY(0deg); } to { transform:rotateX(720deg) rotateY(1080deg); } }