.dr { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.dr__dice { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; }
.dr__die { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .55rem .2rem; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; cursor: pointer; color: var(--ink); font: inherit; transition: transform .1s, border-color .15s; min-height: 72px; }
.dr__die:hover { border-color: var(--accent); transform: translateY(-1px); }
.dr__die:active { transform: scale(.96); }
.dr__die b { font-size: .9rem; }
.dr__shape { width: 34px; height: 34px; background: var(--accent); display: block; }
.dr__shape--d4 { clip-path: polygon(50% 5%, 95% 90%, 5% 90%); }
.dr__shape--d6 { border-radius: 6px; width: 30px; height: 30px; }
.dr__shape--d8 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.dr__shape--d10 { clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); }
.dr__shape--d12 { clip-path: polygon(50% 0, 98% 35%, 80% 95%, 20% 95%, 2% 35%); }
.dr__shape--d20 { clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); background: var(--gold); }
.dr__shape--d100 { border-radius: 50%; background: #7a2d8c; }
.dr__mods { display: flex; gap: .4rem; margin: .7rem 0; flex-wrap: wrap; }
.dr__form { display: flex; gap: .5rem; }
.dr__form input { flex: 1; min-width: 0; font: 600 1.15rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .65rem .8rem; }
.dr__quick { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .8rem 0 .4rem; }
.dr__quick input { width: 74px; text-align: center; min-height: 36px; padding: .3rem; }
.dr__examples .chip { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); font: 600 .82rem ui-monospace, monospace; padding: .3rem .6rem; border-radius: 999px; color: var(--ink-soft); min-height: 32px; }
.dr__result { text-align: center; padding: 1.2rem 1rem; margin: 1rem 0; border-radius: var(--radius-sm); background: linear-gradient(160deg, #2a1d12, #3e2a19); color: #f5efe2; }
.dr__total { font: 700 4rem/1 var(--font-display); color: #f2d48a; }
.dr__total.is-crit { color: #8ce99a; } .dr__total.is-fumble { color: #ff8a80; }
.dr__total.is-anim { animation: drpop .35s ease-out; }
@keyframes drpop { 0% { transform: scale(.6) rotate(-8deg); opacity: .3; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.dr__label { font-size: .95rem; opacity: .85; margin-top: .3rem; font-family: ui-monospace, monospace; }
.dr__break { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: .8rem; }
.dr__chip { min-width: 2.1rem; padding: .25rem .45rem; border-radius: 6px; background: rgba(255,255,255,.12); font-weight: 700; font-size: .95rem; }
.dr__chip.is-max { background: #2f7a3f; } .dr__chip.is-min { background: #9c2a22; } .dr__chip.is-drop { opacity: .4; text-decoration: line-through; }
.dr__op { opacity: .7; align-self: center; }
.dr__stats { font-size: .82rem; opacity: .75; margin-top: .7rem; }
.dr__odds { font: 700 1.6rem/1.2 var(--font-display); color: var(--accent); padding-top: .2rem; }
.dr__abil { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: .8rem; }
.dr__abil > div { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; text-align: center; background: var(--surface); }
.dr__abil b { font: 700 1.6rem/1 var(--font-display); display: block; }
.dr__abil span { font-size: .8rem; color: var(--ink-soft); }
.dr__abil s { opacity: .55; }
.dr__box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; background: var(--surface); margin-bottom: 1rem; }
.dr__save { display: flex; gap: .35rem; }
.dr__save input { flex: 1; min-width: 0; }
.dr__macros { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .3rem; }
.dr__macros li { display: flex; gap: .3rem; align-items: center; }
.dr__macros button.dr__m { flex: 1; text-align: left; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; padding: .4rem .55rem; cursor: pointer; font: inherit; font-size: .88rem; color: var(--ink); min-height: 36px; }
.dr__macros button.dr__m small { color: var(--ink-soft); font-family: ui-monospace, monospace; margin-left: .3rem; }
.dr__macros button.dr__x { border: 0; background: none; cursor: pointer; color: var(--ink-soft); width: 32px; height: 32px; }
.dr__hist { padding-left: 1.3rem; margin: .4rem 0 .7rem; max-height: 420px; overflow: auto; font-size: .88rem; }
.dr__hist li { padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.dr__hist b { font-size: 1rem; }
.dr__hist code { font-size: .8rem; }
@media (max-width: 900px) { .dr { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .dr__dice { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dr__total { font-size: 3.2rem; } }
