/* Painted table and raster-faced cubes; motion runs only during a player's roll. */
#modal-root .modal.hearth-dice-modal{width:min(100%,520px)!important;height:min(100dvh,920px)!important;max-height:100dvh!important;min-height:0!important;box-sizing:border-box;margin:0!important;padding:0!important;overflow:hidden!important;border-radius:18px 18px 0 0;background:#f9f2df;gap:0!important}
.hearth-game{display:flex;flex-direction:column;height:100%;min-height:0;position:relative;overflow:hidden;color:#3c5b4c;font-family:Interface,sans-serif}
.hearth-header{flex:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 16px 10px;background:#fcf7e9;border-bottom:1px solid #d8caa9;z-index:3}
.hearth-header>div:first-child{min-width:0}.hearth-header small{font-size:calc(10px);line-height:1.2;color:#948568}.hearth-header h2{font:700 calc(19px)/1.2 Interface,sans-serif;margin:3px 0 0}.hearth-header>div:last-child{display:flex;gap:7px;flex:none}
.hearth-header .icon-button,.hearth-rules .icon-button{display:grid;place-items:center;min-width:32px;width:32px;height:32px;min-height:32px;margin:0;padding:0;line-height:1;font-size:calc(21px);border-radius:10px}
.hearth-wallet{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 16px;font-size:calc(11px);line-height:1.25;background:#f4ecd7;color:#8d8064;border-bottom:1px solid #d8c8a3;z-index:2}
.hearth-wallet b,.hearth-stakes button,.hearth-payout{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-variant-numeric:tabular-nums}.hearth-wallet b{color:#7a7449;font-size:calc(13px)}.hearth-wallet img{width:22px;height:22px;object-fit:contain}
.hearth-table{position:relative;flex:1;min-height:270px;overflow:hidden;isolation:isolate;background:#65503b url('art/hearth-dice-20261108/table.webp') center/cover no-repeat}
.hearth-table::after{content:'';pointer-events:none;position:absolute;inset:0;z-index:-1;background:linear-gradient(#191b1659,transparent 35%,transparent 65%,#211b1752)}
.hearth-ulf{position:absolute;top:0;left:50%;transform:translateX(-50%);height:35%;max-height:190px;min-height:100px;width:76%;object-fit:contain;object-position:center top;pointer-events:none;filter:drop-shadow(0 5px 5px #1b170e55)}
.hearth-ulf-cup{position:absolute;left:50%;top:25%;transform:translateX(-50%);width:42px;height:48px;object-fit:contain;pointer-events:none;filter:drop-shadow(2px 4px 3px #1b170e77)}
.hearth-hand{position:absolute;left:50%;width:min(85%,350px);transform:translateX(-50%);z-index:2}.hearth-hand[hidden]{display:none}.hearth-hand-ulf{top:35%}.hearth-hand-player{top:58%}
.hearth-hand-label{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:0 6px 5px;font-size:calc(11px);line-height:1.2;color:#f4ead2;text-shadow:0 1px 3px #1d140d}.hearth-hand-label b{font-size:calc(10px);font-weight:500;color:#e0d7bb}
.hearth-dice-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;justify-items:center;align-items:center}
.hearth-die{position:relative;display:block;flex:none;width:62px;height:65px;min-width:0;min-height:0!important;padding:5px!important;margin:0!important;border:1px solid transparent;border-radius:10px;background:transparent!important;box-shadow:none!important;overflow:visible!important;opacity:1!important;perspective:650px;touch-action:manipulation;isolation:isolate}
.hearth-die:disabled{filter:none!important;opacity:1!important}.hearth-die.is-held{border-color:#dceab1;background:#c4d39a33!important}.hearth-die-shadow{position:absolute;left:9px;right:3px;bottom:6px;height:10px;z-index:-1;border-radius:50%;background:#1b130f55;filter:blur(4px)}
.hearth-die-flight{position:relative;display:block;width:48px;height:48px;transform-style:preserve-3d;will-change:auto}.is-rolling .hearth-die-flight{will-change:transform}.hearth-die-cube{position:relative;display:block;width:48px;height:48px;transform-style:preserve-3d;will-change:auto}.is-rolling .hearth-die-cube{will-change:transform}
.hearth-face{position:absolute;display:block;inset:0;width:48px!important;height:48px!important;object-fit:cover;backface-visibility:hidden;border-radius:7px;pointer-events:none;box-shadow:inset 0 0 0 1px #4e321b33}
.hearth-face-0{transform:translateZ(24px)}.hearth-face-1{transform:rotateY(180deg) translateZ(24px)}.hearth-face-2{transform:rotateY(90deg) translateZ(24px)}.hearth-face-3{transform:rotateY(-90deg) translateZ(24px)}.hearth-face-4{transform:rotateX(90deg) translateZ(24px)}.hearth-face-5{transform:rotateX(-90deg) translateZ(24px)}
.hearth-held-label{position:absolute;left:50%;bottom:-9px;transform:translateX(-50%);display:none;padding:2px 5px;border-radius:5px;background:#e7efd8;color:#4d6c48;font-size:calc(8px);line-height:1.2;white-space:nowrap;pointer-events:none;box-shadow:0 1px 3px #2c281c44}.hearth-die.is-held .hearth-held-label{display:block}
.hearth-player-cup{position:absolute;left:calc(50% - 46px);bottom:0;width:92px;height:92px;min-height:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important;touch-action:none;z-index:3;transform-origin:50% 80%;cursor:grab;overflow:visible!important}.hearth-player-cup:active{cursor:grabbing}.hearth-player-cup:disabled{opacity:.8!important;filter:none!important}
.hearth-player-cup>img{display:block;width:86px;height:78px;object-fit:contain;filter:drop-shadow(2px 5px 4px #1b170e88);pointer-events:none}.hearth-player-cup>span{position:absolute;left:50%;bottom:3px;transform:translateX(-50%);width:max-content;max-width:220px;padding:3px 7px;background:#2c271d80;border-radius:6px;color:#f4ebd3;font-size:calc(9px);line-height:1.2;pointer-events:none}
.hearth-controls{flex:none;display:flex;flex-direction:column;gap:9px;padding:11px 14px 12px;background:#fcf7e9;box-shadow:0 -4px 18px #211a1430;z-index:4}
.hearth-message{min-height:50px;text-align:center}.hearth-message>strong{display:block;font-size:calc(16px);line-height:1.25;color:#3f6250}.hearth-message>p{margin:4px auto 0;max-width:410px;font-size:calc(11px);line-height:1.4;color:#8e8469}.hearth-payout{margin-top:7px;font-size:calc(20px);font-weight:700;color:#8b7838}.hearth-payout[hidden]{display:none}.hearth-payout>img{width:30px;height:30px;object-fit:contain}.hearth-payout small{font-size:calc(10px);font-weight:400;color:#9b8c68}
.hearth-stakes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.hearth-stakes>button{height:35px;min-height:35px;margin:0;padding:0 7px;border:1px solid #d7cba8;border-radius:9px;background:#f6edda;color:#8b7845;font-size:calc(13px);font-weight:700}.hearth-stakes img{width:22px;height:22px;object-fit:contain}.hearth-stakes>button[aria-pressed="true"]{border-color:#729877;background:#e8efd7;box-shadow:inset 0 0 0 1px #91aa83;color:#446d50}
.hearth-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.hearth-actions.has-stand{grid-template-columns:repeat(2,minmax(0,1fr))}.hearth-actions button{min-width:0!important;min-height:40px;margin:0!important;padding:8px 6px!important;font-size:calc(13px);line-height:1.25;border-radius:10px}.hearth-actions [hidden]{display:none!important}.hearth-loss{font-size:calc(9px);line-height:1.25;text-align:center;color:#a19478}.hearth-error{margin:0;font-size:calc(11px);line-height:1.4;text-align:center;color:#aa5d45}
.hearth-rules{position:absolute;inset:0;z-index:10;display:flex;flex-direction:column;background:#fcf7e9;padding:14px 16px;box-sizing:border-box}.hearth-rules>header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;padding-bottom:10px;border-bottom:1px solid #d8cbaa}.hearth-rules h3{font:700 calc(19px)/1.2 Interface,sans-serif;margin:0}.hearth-rules>div{overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:none;padding-top:4px;min-height:0}.hearth-rules>div::-webkit-scrollbar{display:none}.hearth-rules p,.hearth-rules li{font-size:calc(12px);line-height:1.5;color:#787a63}.hearth-rules ol{padding-left:25px}.hearth-rules table{width:100%;border-collapse:collapse;font-size:calc(12px)}.hearth-rules th,.hearth-rules td{padding:8px 2px;border-bottom:1px solid #dfd4b7;text-align:left}.hearth-rules th{font-weight:500}.hearth-rules td{text-align:right;font-weight:700;color:#8c7845;white-space:nowrap}
@media(max-height:680px){.hearth-header{padding:8px 12px 7px}.hearth-header h2{font-size:calc(17px)}.hearth-header small{display:none}.hearth-wallet{padding:5px 12px}.hearth-controls{gap:6px;padding:8px 12px 9px}.hearth-message{min-height:42px}.hearth-message>strong{font-size:calc(14px)}.hearth-message>p{font-size:calc(10px)}.hearth-stakes>button{height:31px;min-height:31px}.hearth-actions button{min-height:36px}.hearth-table{min-height:240px}.hearth-hand-player{top:52%}.hearth-hand-ulf{top:28%}.hearth-ulf-cup{top:20%}.hearth-player-cup{left:calc(50% - 38px);width:76px;height:50px}.hearth-player-cup>img{width:72px;height:48px}.hearth-die{width:52px;height:46px;padding:3px!important}.hearth-die-flight,.hearth-die-cube{width:42px;height:42px}.hearth-face{width:42px!important;height:42px!important}.hearth-face-0{transform:translateZ(21px)}.hearth-face-1{transform:rotateY(180deg) translateZ(21px)}.hearth-face-2{transform:rotateY(90deg) translateZ(21px)}.hearth-face-3{transform:rotateY(-90deg) translateZ(21px)}.hearth-face-4{transform:rotateX(90deg) translateZ(21px)}.hearth-face-5{transform:rotateX(-90deg) translateZ(21px)}}
@media(prefers-reduced-motion:reduce){.hearth-die-flight,.hearth-die-cube{will-change:auto!important}.hearth-table *, .hearth-controls *{transition:none!important;animation:none!important}}

.hearth-payout{display:grid;gap:3px;width:min(100%,280px);margin:8px auto 0;font-size:calc(11px);line-height:1.25;font-weight:500;color:#8c8268}
.hearth-payout>span{display:flex;align-items:center;justify-content:space-between;gap:12px}.hearth-payout b{font-weight:700;font-variant-numeric:tabular-nums}
.hearth-payout .is-total{padding-top:4px;border-top:1px solid #ded4b8;color:#70643f}.hearth-payout .is-total>b{display:flex;align-items:center;gap:5px;font-size:calc(16px)}.hearth-payout .is-total img{width:23px;height:23px;object-fit:contain}.hearth-payout>small{font-size:calc(9px);font-weight:400;text-align:right;color:#a29678}

.hearth-ulf-speech{position:absolute;left:8px;top:10px;z-index:4;max-width:110px;padding:7px 9px;box-sizing:border-box;background:#fbf2dbeb;border:1px solid #c4b18b;border-radius:10px;font-size:calc(10px);line-height:1.35;color:#75654b;box-shadow:0 2px 7px #20170b33;pointer-events:none}.hearth-ulf-speech[hidden]{display:none}
.hearth-pot{position:absolute;right:5px;top:48%;z-index:1;display:flex;flex-direction:column;align-items:center;width:46px;pointer-events:none}.hearth-pot>img{width:40px;height:34px;object-fit:contain;filter:drop-shadow(1px 3px 3px #20140b88)}.hearth-pot>span{margin-top:2px;font-size:calc(8px);line-height:1.3;text-align:center;color:#f5e8c7;text-shadow:0 1px 3px #20170b}.hearth-pot b{font-variant-numeric:tabular-nums}
.hearth-flying-coin{position:absolute;width:22px;height:22px;object-fit:contain;pointer-events:none;z-index:6;will-change:transform,opacity}
.hearth-candle-flash{position:absolute;inset:0;z-index:5;pointer-events:none;opacity:0;background:radial-gradient(ellipse at 10% 5%,#f5c86c,transparent 45%),radial-gradient(ellipse at 90% 8%,#f5bd61,transparent 45%)}
.hearth-die.is-moving .hearth-face{filter:blur(.25px)}
@media(prefers-reduced-motion:reduce){.hearth-die.is-moving .hearth-face{filter:none}.hearth-candle-flash,.hearth-flying-coin{display:none}}

#modal-root>.modal-shade.hearth-dice-shade{padding:0!important;align-items:stretch!important;justify-content:center}
@media(max-width:540px){#modal-root .modal.hearth-dice-modal{width:100vw!important;height:100dvh!important;border-radius:0!important;border-width:0!important}}
