/* Spec 424: the public tool pages. The blocks, the FAQ and the buttons come from rules-pages.css and home-landing.css;
   this sheet holds the frame's top bar, the theme toggle, the account pitch and the inline dice tool. Every colour is a
   tabletop token, so the light and the dark theme both follow html[data-theme]. */

.rules-page.public-tool-page {
    width: min(900px, 100%);
}

.rules-guest .rules-page.public-tool-page {
    width: min(900px, 100% - 2rem);
}

/* Rule 11: on phones the tools wrap onto a second row; from 900 px the bar is one row. */
.pt-topbar {
    position: static;
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

.pt-nav {
    order: 3;
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.92rem;
}

.pt-nav a {
    display: inline-block;
    padding: 0.4rem 0;
    color: var(--tt-ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.pt-nav a:hover {
    color: var(--tt-accent);
}

.pt-nav a.is-active {
    border-bottom-color: var(--tt-rule);
}

.pt-theme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
    color: var(--tt-ink);
    cursor: pointer;
}

.pt-theme:hover {
    color: var(--tt-accent);
}

.pt-theme-moon,
html[data-theme="light"] .pt-theme-sun {
    display: none;
}

html[data-theme="light"] .pt-theme-moon {
    display: block;
}

@media (min-width: 768px) {
    .pt-topbar {
        position: sticky;
    }
}

@media (min-width: 900px) {
    .pt-topbar {
        flex-wrap: nowrap;
    }

    .pt-nav {
        order: 0;
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 374px) {
    .pt-theme {
        width: 2rem;
        height: 2rem;
    }
}

/* Rules 13-17: the account pitch. */
.pt-pitch-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
}

.rules-page .pt-pitch-line p {
    flex: 1 1 16rem;
    margin: 0;
    color: var(--tt-muted);
}

.pt-pitch-gains {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding: 0;
    list-style: none;
}

.pt-pitch-gains li {
    position: relative;
    padding-left: 1.6rem;
}

/* A small cut-corner token before each gain, the accent of the tabletop look. */
.pt-pitch-gains li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.45em;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--tt-accent);
    clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}

.pt-pitch--app p {
    margin: 0;
}

.pt-more-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Rule 27: the dice roller of the app's panel, drawn inline on the page. */
.dice-inline {
    max-width: 34rem;
    margin-inline: auto;
}

.dice-inline .dice-tray {
    min-height: 120px;
    align-items: center;
    gap: 18px;
    padding: 1rem 0.5rem;
    border: 1px solid var(--tt-line);
    background: var(--tt-field);
}

.dice-inline .dice-result {
    margin: 0.75rem 0;
    font-size: 1.25rem;
}

.dice-inline .dice-actions {
    margin-bottom: 0.75rem;
}

.dice-inline .dice-roll-btn {
    min-height: 3rem;
    font-size: 1.1rem;
}

.dice-inline .dice-clear-btn {
    min-height: 2.75rem;
}

.dice-inline .dice-pick-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 0.25rem 1.25rem;
}

.dice-inline .dice-pick-btn {
    width: 2.75rem;
    height: 2.75rem;
}

.dice-inline .dice-history-head {
    margin-top: 0.5rem;
}

.rules-page .dice-inline .dice-section-title {
    margin: 0;
    font-family: var(--tt-font-text);
}

.rules-page .dice-inline :is(ul, ol) {
    margin-bottom: 0;
}
