.rng-block {
    max-width: 32rem;
}

.rng-result-wrap {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(125, 206, 160, 0.12), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(74, 143, 212, 0.1), transparent 50%),
        rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rng-result {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #f2f4f7;
    font-variant-numeric: tabular-nums;
    min-height: 1.1em;
}

.rng-result.is-roll {
    animation: rng-pop 0.28s ease-out;
}

@keyframes rng-pop {
    0% { transform: scale(0.86); opacity: 0.35; }
    60% { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1); }
}

.rng-range-label {
    margin-top: 0.65rem;
}

.rng-presets .rng-preset.is-active {
    background: rgba(125, 206, 160, 0.18);
    border-color: rgba(125, 206, 160, 0.55);
    color: #d8f3e4;
}

.rng-history__title {
    letter-spacing: 0.06em;
    font-weight: 600;
}

.rng-history__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 1.75rem;
}

.rng-history__list:empty::after {
    content: 'No rolls yet';
    color: var(--site-text-muted, #8fa3bf);
    font-size: 0.85rem;
}

.rng-history__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

/* —— Compact popup window —— */
.rng-popup-body {
    margin: 0;
    min-height: 100vh;
    background: #121820;
    color: #eef2f6;
    font-family: Georgia, 'Times New Roman', serif;
    -webkit-user-select: none;
    user-select: none;
}

.rng-popup {
    box-sizing: border-box;
    min-height: 100vh;
    padding: 0.7rem 0.75rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.45rem;
    background:
        radial-gradient(ellipse at 25% 15%, rgba(125, 206, 160, 0.14), transparent 50%),
        radial-gradient(ellipse at 85% 90%, rgba(74, 143, 212, 0.12), transparent 45%),
        #121820;
    cursor: pointer;
}

.rng-popup__result {
    text-align: center;
    font-size: clamp(2.8rem, 22vw, 3.6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #f5f7fa;
    min-height: 1.05em;
}

.rng-popup__result.is-roll {
    animation: rng-pop 0.28s ease-out;
}

.rng-popup__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: system-ui, sans-serif;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 0.1rem;
}

.rng-popup__hint {
    opacity: 0.8;
}

.rng-popup__controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rng-popup__input {
    width: 3.4rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.3rem;
    background: rgba(0, 0, 0, 0.35);
    color: #f0f3f7;
    font-size: 0.85rem;
    padding: 0.25rem 0.3rem;
    font-family: system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

.rng-popup__input:focus {
    outline: 1px solid rgba(125, 206, 160, 0.7);
    border-color: rgba(125, 206, 160, 0.5);
}

.rng-popup__dash {
    color: rgba(255, 255, 255, 0.4);
    font-family: system-ui, sans-serif;
}

.rng-popup__btn {
    margin-left: auto;
    border: 0;
    border-radius: 0.35rem;
    background: #2f8f62;
    color: #fff;
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
}

.rng-popup__btn:hover {
    background: #37a572;
}

.rng-popup__error {
    margin: 0;
    font-family: system-ui, sans-serif;
    font-size: 0.72rem;
    color: #f07178;
}
