.three-piles { --pile-ink: #6f5326; --pile-face: #efd295; --pile-edge: #c69a50; --pile-side: #d7b273; border-radius: 4px; }
.three-piles[hidden] { display: none; }
.three-piles *, .three-piles *::before, .three-piles *::after { box-sizing: border-box; }
.three-piles .piles-settings { gap: 12px 18px; }
.three-piles button, .three-piles select { font-size: 16px; touch-action: manipulation; }
.three-piles .piles-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; margin: 20px 0 18px; border-block: 1px solid #ddd; text-align: center; }
.three-piles .piles-stats dt { font-size: 14px; }
.three-piles .piles-stats dd { font-size: 25px; margin: 0; }
.three-piles .piles-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 8px; align-items: stretch; margin: 14px 0 24px; }
.three-piles .piles-slot { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 2px 8px; border: 1px solid transparent; border-radius: 5px; }
.three-piles .piles-slot[data-new="true"] { --pile-ink: #116969; --pile-face: #91d1c9; --pile-edge: #3b8e88; --pile-side: #66afa7; background: #eef8f6; border-color: #599e98; border-style: dashed; }
.three-piles .piles-badge { height: 25px; line-height: 25px; font-size: 14px; color: #116969; }
.three-piles .piles-stack { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: var(--stack-height, 92px); }
.three-piles .piles-stack svg { display: block; width: min(100%, 72px); height: 100%; overflow: visible; }
.three-piles .piles-coin-side { fill: var(--pile-side); stroke: var(--pile-edge); stroke-width: 1.1px; }
.three-piles .piles-coin-top { fill: var(--pile-face); stroke: var(--pile-ink); stroke-width: 1px; }
.three-piles .piles-empty { fill: none; stroke: #b8bfbd; stroke-width: 1.2px; stroke-dasharray: 3 3; }
.three-piles .piles-amount { display: block; font-size: 21px; line-height: 32px; margin-bottom: 5px; }
.three-piles .piles-slot[data-count="0"] .piles-amount { color: #7b817e; }
.three-piles .piles-adjust { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.three-piles .piles-adjust button { width: 48px; height: 44px; padding: 0; font-family: sans-serif; font-size: 23px; line-height: 1; }
.three-piles .piles-actions { justify-content: center; gap: 8px; }
.three-piles .piles-actions button { flex: 1 1 100px; max-width: 190px; }
.three-piles .piles-primary:not(:disabled) { background: #087b7f; border-color: #087b7f; color: #fff; }
.three-piles .piles-primary:not(:disabled):hover { background: #066165; }
.three-piles .piles-status { min-height: 3.3em; margin: 14px 0 0; font-size: 15px; text-align: center; overflow-wrap: anywhere; }
.three-piles .piles-status[data-repeated="true"] { color: #8a492a; }
.three-piles .piles-slot[data-animate="true"] .piles-stack { animation: piles-appear 220ms ease-out; }
@keyframes piles-appear { from { opacity: .4; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 650px) {
    .three-piles .piles-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 6px; }
}
@media (max-width: 380px) {
    .three-piles { padding: 10px; }
    .three-piles .piles-settings { gap: 10px; }
    .three-piles .piles-actions button { flex-basis: 64px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .three-piles .piles-slot[data-animate="true"] .piles-stack { animation: none; }
}
