/* ==================================================================
   RAMAPANI DICE (1.0.0)
   The family card: warm ink on cream, one accent (a deep teal, the
   companion to Ramapaniching's rust), round buttons and tabs, and a
   felt tray in dark green where the ivory dice land. In Ramapani
   Retreats the card follows the skin (data-hscheme, protocol 1.2).
================================================================== */
.dice {
    --d-ink: #2f2a24; --d-muted: #786d5f; --d-line: #e2d8c6; --d-chip: #f5efe4; --d-card: #fffdf8;
    --d-accent: #2f6f6a; --d-btn-ink: #fbfaf6; --d-felt-a: #1f4a41; --d-felt-b: #13302b;
    color: var(--d-ink); text-align: center;
    max-width: 560px; margin: 1.5rem auto; padding: 0 0 1rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.5;
    background: var(--d-card); border: 1px solid var(--d-line); border-radius: 16px; overflow: hidden; box-sizing: border-box;
}
.dice *, .dice *::before, .dice *::after { box-sizing: border-box; }
.dice a { color: var(--d-accent); }

.dice-head { padding: 1rem 1rem .3rem; }
.dice-app-name { margin: 0; font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 600; letter-spacing: .04em; }
.dice-tag { margin: 0; color: var(--d-muted); font-size: .9rem; }
.dice-label { margin: .3rem 0 0; color: var(--d-accent); font-size: .9rem; }

.dice-tabs { display: flex; justify-content: center; gap: 6px; padding: .5rem .8rem .3rem; }
.dice-tab { font: inherit; font-size: .92rem; cursor: pointer; color: var(--d-muted); background: transparent; border: 1px solid var(--d-line); border-radius: 999px; padding: .32rem .95rem; }
.dice-tab:hover { color: var(--d-ink); }
.dice-tab.is-active { color: var(--d-btn-ink); background: var(--d-accent); border-color: var(--d-accent); }
.dice-panel { padding: .5rem 1rem .2rem; }
.dice-panel[hidden] { display: none; }

/* the tray */
.dice-tray { display: block; width: 100%; height: 190px; border-radius: 14px; cursor: pointer;
    background: radial-gradient(ellipse at 50% 40%, var(--d-felt-a), var(--d-felt-b) 75%);
    box-shadow: inset 0 0 0 6px #5b3b22, inset 0 0 0 7px rgba(0,0,0,.35), inset 0 6px 18px rgba(0,0,0,.45); }
.dice-tray:focus-visible { outline: 3px solid var(--d-accent); outline-offset: 3px; }
.dice.is-rolling .dice-tray { cursor: progress; }

.dice-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: .8rem 0 .2rem; }
.dice-modes { display: inline-flex; border: 1px solid var(--d-line); border-radius: 999px; overflow: hidden; }
.dice-mode { font: inherit; font-size: .82rem; cursor: pointer; background: transparent; color: var(--d-muted); border: 0; padding: .35rem .8rem; }
.dice-mode[aria-pressed="true"] { background: var(--d-chip); color: var(--d-ink); font-weight: 600; }
.dice-btn { display: inline-block; font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; color: var(--d-ink) !important;
    background: var(--d-chip); border: 1px solid var(--d-line); border-radius: 999px; padding: .5rem 1.1rem; transition: transform .15s ease; }
.dice-btn:hover { transform: translateY(-1px); }
.dice-btn.is-main { color: var(--d-btn-ink) !important; background: var(--d-accent); border-color: var(--d-accent); font-weight: 600; }
.dice-btn.is-big { font-size: 1.05rem; padding: .62rem 1.5rem; }
.dice-link { font: inherit; font-size: .85rem; cursor: pointer; color: var(--d-accent); background: none; border: 0; padding: .2rem .3rem; text-decoration: underline; text-underline-offset: 3px; }
.dice :focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; }
.dice-status { min-height: 1.4em; margin: .2rem 0; color: var(--d-muted); font-size: .88rem; }
.dice-msg { min-height: 1.3em; margin: .2rem 0; color: var(--d-accent); font-size: .88rem; }

/* the result */
.dice-result { margin-top: .4rem; animation: dice-rise .6s ease; }
@keyframes dice-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dice-rolls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 0 .8rem; }
.dice-rolls span { display: flex; flex-direction: column; align-items: center; padding: .3rem .1rem; border-radius: 10px; background: var(--d-chip); }
.dice-rolls b { font-family: Georgia, serif; font-size: 1.3rem; line-height: 1.1; }
.dice-rolls small { font-size: .66rem; color: var(--d-muted); line-height: 1.2; }
.dice-reading { display: flex; align-items: center; justify-content: center; gap: 18px; text-align: left; flex-wrap: wrap; }
.dice-fig rect { fill: var(--d-ink); }
.dice-fig .mv { fill: none; stroke: var(--d-accent); stroke-width: 2.4; }
.dice-names { min-width: 0; max-width: 300px; }
.dice-kicker { margin: 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--d-muted); }
.dice-hex { margin: .1rem 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.55rem; line-height: 1.15; }
.dice-glyph { font-weight: 400; color: var(--d-muted); }
.dice-modern { margin: 0 0 .4rem; font-style: italic; color: var(--d-muted); }
.dice-becoming { margin: 0; font-size: .95rem; }
.dice-becoming small { color: var(--d-muted); }
.dice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 1rem 0 .2rem; }
.dice-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: .3rem 0; }
.dice-social { font-size: .8rem; text-decoration: none; color: var(--d-muted) !important; border: 1px solid var(--d-line); border-radius: 999px; padding: .2rem .65rem; }
.dice-social:hover { color: var(--d-ink) !important; border-color: var(--d-accent); }

/* rolls and about */
.dice-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.5rem; margin: .3rem 0; }
.dice-lead { color: var(--d-muted); margin: .3rem 0 .8rem; font-size: .95rem; }
.dice-history { list-style: none; margin: 0; padding: 0; text-align: left; }
.dice-history li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: .45rem 0; border-bottom: 1px solid var(--d-line); font-size: .92rem; }
.dice-sub { color: var(--d-muted); font-size: .82rem; }
.dice-hist-acts { display: flex; gap: 4px; }
.dice-actions { margin: 1rem 0 .3rem; }
.dice h4 { margin: 1.1rem 0 .4rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--d-accent); }
.dice-table { width: 100%; border-collapse: collapse; font-size: .9rem; text-align: left; }
.dice-table th, .dice-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--d-line); vertical-align: top; }
.dice-table th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--d-muted); }
.dice-box { text-align: left; padding: .2rem .9rem; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-chip); font-size: .93rem; }
[data-panel="about"] > p { text-align: left; }
.dice-version { color: var(--d-muted); font-size: .8rem; text-align: center !important; margin-top: 1.1rem; }
.dice-privacy { margin: .6rem 1.2rem 0; font-size: .78rem; color: var(--d-muted); }
.dice-home { margin: .3rem 0 0; font-size: .85rem; }

/* ---- Ramapani Retreats: the house colours, light and dark by the skin ---- */
.dice.is-hermitage { --d-ink: #2c2a26; --d-muted: #6f6a60; --d-line: #d4ccbd; --d-chip: #f1ede4; --d-card: #fbfaf6; --d-accent: #6d7f6a; }
html[data-hscheme="dark"] .dice.is-hermitage { --d-ink: #ece7dd; --d-muted: #aaa293; --d-line: #403c33; --d-chip: #26241f; --d-card: #1e1d19; --d-accent: #a3b69f; --d-btn-ink: #1b1a17; }
@media (prefers-color-scheme: dark) {
    html:not([data-hscheme]) .dice.is-hermitage { --d-ink: #ece7dd; --d-muted: #aaa293; --d-line: #403c33; --d-chip: #26241f; --d-card: #1e1d19; --d-accent: #a3b69f; --d-btn-ink: #1b1a17; }
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    html[data-hscheme][data-hskin] .dice.is-hermitage {
        --d-card: var(--h-bg); --d-ink: var(--h-ink); --d-accent: var(--h-accent);
        --d-muted: color-mix(in srgb, var(--h-ink) 68%, var(--h-bg));
        --d-line: color-mix(in srgb, var(--h-ink) 20%, var(--h-bg));
        --d-chip: color-mix(in srgb, var(--h-ink) 7%, var(--h-bg));
    }
}

@media (max-width: 460px) {
    .dice-panel { padding: .4rem .6rem .2rem; }
    .dice-tray { height: 150px; }
    .dice-rolls small { font-size: .58rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dice *, .dice *::before, .dice *::after { animation: none !important; transition: none !important; }
}
