:root {
    --bg: #262421;
    --panel: #272421;
    --card: #302E2B;
    --surface: #3D3A36;
    --surface-h: #4A4643;
    --text: #F0F0F0;
    --text-2: #BABABA;
    --text-3: #989795;
    --text-4: #6E6C68;
    --green: #81B64C;
    --green-d: #629924;
    --green-bg: rgba(129, 182, 76, 0.14);
    --amber: #E8A93E;
    --cyan: #5DADE2;
    --b1: rgba(255, 255, 255, 0.08);
    --b2: rgba(255, 255, 255, 0.15);
    --r: 8px;
    --r-lg: 12px;
    --r-sm: 4px;
    --f-sans: 'Outfit', -apple-system, sans-serif;
    --f-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-sans);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.skip-to-main {
    position: absolute;
    left: 16px;
    top: -64px;
    z-index: 120;
    padding: 10px 14px;
    border-radius: var(--r);
    background: var(--green);
    color: #183000;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-to-main:focus {
    top: 16px;
}

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: calc(var(--header-h, 56px) + 32px) 24px 96px;
}

nav.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-4);
    margin-bottom: 28px;
}

nav.breadcrumb a {
    color: var(--text-4);
}

nav.breadcrumb a:hover {
    color: var(--green);
    text-decoration: none;
}

nav.breadcrumb span {
    margin: 0 6px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.page-intro {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 44px;
    padding-bottom: 44px;
    border-bottom: 1px solid var(--b2);
}

h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 40px 0 12px;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 8px;
}

p {
    color: var(--text-2);
    margin-bottom: 12px;
    line-height: 1.7;
}

p:last-child {
    margin-bottom: 0;
}

p strong,
li strong {
    color: var(--text);
}

ul,
ol {
    margin: 8px 0 16px 22px;
    color: var(--text-2);
}

li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--b2);
    border-radius: var(--r-lg);
    padding: 18px;
    text-align: center;
}

.stat-value {
    font-family: var(--f-mono);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 6px;
    font-weight: 600;
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 16px 0 20px;
}

.dice-card {
    background: var(--card);
    border: 1px solid var(--b2);
    border-radius: var(--r);
    padding: 12px 8px;
    text-align: center;
}

.die-name {
    display: block;
    font-family: var(--f-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--green);
}

.die-range {
    display: block;
    font-size: 0.75rem;
    color: var(--text-4);
    margin-top: 3px;
}

.example {
    background: var(--card);
    border: 1px solid var(--b2);
    border-left: 3px solid var(--green);
    border-radius: var(--r);
    padding: 14px 18px;
    margin: 14px 0;
}

.example-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.example p {
    margin: 0;
    font-size: 0.9rem;
}

.expr {
    font-family: var(--f-mono);
    background: var(--surface);
    padding: 1px 7px;
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    color: var(--text);
}

.kb-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.88rem;
}

.kb-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 8px 12px;
    border-bottom: 1px solid var(--b2);
}

.kb-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--b1);
    color: var(--text-2);
}

.kb-table tr:last-child td {
    border-bottom: none;
}

kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--b2);
    border-radius: var(--r-sm);
}

.cta-box {
    background: var(--green-bg);
    border: 1px solid rgba(129, 182, 76, 0.3);
    border-radius: var(--r-lg);
    padding: 28px 24px;
    text-align: center;
    margin-top: 48px;
}

.cta-box p {
    color: var(--text-2);
    margin-bottom: 16px;
}

.cta-btn {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 11px 30px;
    border-radius: var(--r);
    text-decoration: none;
    transition: background 0.15s;
}

.cta-btn:hover {
    background: var(--green-d);
    text-decoration: none;
}

.page-footer {
    margin-top: 64px;
    padding-top: 20px;
    border-top: 1px solid var(--b2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-4);
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: var(--text-4);
}

.footer-links a:hover {
    color: var(--green);
    text-decoration: none;
}

@media (max-width: 500px) {
    .stat-row {
        grid-template-columns: 1fr;
    }

    .dice-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
