@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&display=swap');

:root {
    --display-font: "Oswald", ui-sans-serif, system-ui, sans-serif;
    --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #182033;
    --muted: #5f6b7a;
    --line: #e2e6ee;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --soft: #eef4ff;
    --shadow: 0 12px 30px rgba(24, 32, 51, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--body-font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; }

.site-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    backdrop-filter: blur(14px);
    z-index: 10;
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    font-weight: 900;
}

.nav-links {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

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

.hero {
    max-width: 1120px;
    margin: 0 auto;
    padding: 72px 20px 34px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    align-items: center;
}

.eyebrow {
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 0.96;
    letter-spacing: -0.07em;
    margin: 12px 0 18px;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin: 0 0 12px;
}

h3 {
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.18rem;
    color: var(--muted);
    max-width: 680px;
}

.hero-card, .card, .tool-card, .tool-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card { padding: 22px; }
.hero-card-list { display: grid; gap: 12px; }

.mini-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    background: var(--soft);
    border-radius: 14px;
}

.mini-row span { color: var(--muted); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    padding: 12px 18px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:hover { background: var(--brand-dark); }

.button.secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--line);
}

.button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tool-card {
    padding: 20px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(24, 32, 51, 0.12);
}

.tool-card p, .muted { color: var(--muted); }

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 20px;
}

.tool-layout {
    max-width: 920px;
    margin: 0 auto;
    padding: 46px 20px;
}

.tool-panel {
    padding: 24px;
    margin-top: 24px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

label { font-weight: 750; }

input, select, textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font: inherit;
    background: white;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input { width: auto; }

.result {
    margin-top: 18px;
    padding: 18px;
    background: var(--soft);
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 850;
    word-break: break-word;
}

.result-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--soft);
    border-radius: 14px;
    word-break: break-word;
}

.dice-result, .coin-result {
    text-align: center;
    font-size: 4rem;
    line-height: 1;
}

.qr-output {
    display: grid;
    place-items: center;
    min-height: 280px;
    margin-top: 18px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 18px;
}

.qr-output canvas {
    max-width: 100%;
    height: auto !important;
}

.color-preview {
    width: 100%;
    height: 180px;
    border-radius: 18px;
    border: 1px solid var(--line);
    margin-top: 18px;
}

.wheel-wrap {
    display: grid;
    place-items: center;
    margin: 20px 0;
}

.wheel {
    width: min(360px, 80vw);
    height: min(360px, 80vw);
    border-radius: 50%;
    border: 10px solid white;
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    background: conic-gradient(#dbeafe 0deg 60deg, #e0e7ff 60deg 120deg, #ede9fe 120deg 180deg, #f5f3ff 180deg 240deg, #eff6ff 240deg 300deg, #e0f2fe 300deg 360deg);
    transition: transform 2.4s cubic-bezier(.12,.67,.18,1);
}

.wheel-center {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: white;
    border: 1px solid var(--line);
    text-align: center;
    font-weight: 850;
    padding: 10px;
}

.help-list {
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--soft);
    border-radius: 14px;
}

.site-footer {
    margin-top: 50px;
    border-top: 1px solid var(--line);
    background: white;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-inner a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 14px;
}

.footer-inner a:hover { color: var(--brand); }

@media (max-width: 780px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 42px;
    }

    .grid { grid-template-columns: 1fr; }

    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-inner { flex-direction: column; }

    .footer-inner a { margin: 0 14px 0 0; }

    .result-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


.name-result-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.name-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--soft);
    border-radius: 14px;
    font-weight: 800;
    word-break: break-word;
}

.name-tag span {
    color: var(--muted);
    font-weight: 650;
    font-size: 0.92rem;
}

@media (max-width: 780px) {
    .name-tag {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v0.5.0 polish */
.logo,
.nav-links,
.eyebrow,
h1,
h2,
h3,
.button,
.result strong,
.name-tag strong,
.result-row strong,
.mini-row strong,
.result-table-header {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.lead,
.muted,
p,
li,
input,
select,
textarea,
label,
.result span,
.name-tag span {
    font-family: var(--body-font);
    text-transform: none;
    letter-spacing: normal;
}

.tool-helper {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.96rem;
}

.result-table-header,
.name-tag,
.result-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(90px, 160px) auto;
    align-items: center;
    gap: 14px;
}

.result-table-header {
    margin-top: 22px;
    padding: 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.name-tag span,
.result-row span {
    justify-self: center;
}

.name-tag .button,
.result-row .button {
    justify-self: end;
}

.coin-stage {
    display: grid;
    place-items: center;
    min-height: 190px;
}

.coin-disc {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, #fff7c2, #f4b63f 42%, #9a5c08 100%);
    border: 8px solid #f8d36a;
    box-shadow: 0 18px 40px rgba(112, 70, 0, 0.22);
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1b2438;
}

.coin-disc.flipping {
    animation: coinFlipSpin 0.85s ease;
}

@keyframes coinFlipSpin {
    0% { transform: rotateY(0) translateY(0); }
    35% { transform: rotateY(540deg) translateY(-28px); }
    70% { transform: rotateY(900deg) translateY(8px); }
    100% { transform: rotateY(1080deg) translateY(0); }
}

.dice-roll-visual {
    display: inline-grid;
    place-items: center;
    width: 98px;
    height: 98px;
    margin: 0 auto 12px;
    border-radius: 20px;
    background: white;
    border: 2px solid var(--line);
    box-shadow: var(--shadow);
    font-family: var(--display-font);
    font-size: 2.4rem;
}

.dice-roll-visual.rolling {
    animation: diceShake 0.55s ease;
}

@keyframes diceShake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(-7px, 3px) rotate(-8deg); }
    40% { transform: translate(6px, -4px) rotate(8deg); }
    60% { transform: translate(-4px, -2px) rotate(-5deg); }
    80% { transform: translate(3px, 5px) rotate(6deg); }
}

.color-preview {
    transition: background 0.25s ease, transform 0.2s ease;
}

.color-preview.color-pop {
    transform: scale(1.015);
}

.uuid-reveal {
    animation: revealSoft 0.3s ease;
}

@keyframes revealSoft {
    from { opacity: 0.4; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.qr-output img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.wheel-zone {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 22px;
    align-items: start;
}

.wheel-pointer {
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid #111827;
    margin: 0 auto -10px;
    position: relative;
    z-index: 2;
}

.wheel {
    position: relative;
    overflow: hidden;
    background: conic-gradient(#ef4444 0deg 45deg, #f97316 45deg 90deg, #eab308 90deg 135deg, #22c55e 135deg 180deg, #06b6d4 180deg 225deg, #3b82f6 225deg 270deg, #8b5cf6 270deg 315deg, #ec4899 315deg 360deg);
}

.wheel-labels {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.wheel-label {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    transform-origin: 0 0;
    color: white;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.45);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wheel-center {
    position: relative;
    z-index: 1;
}

.wheel-options-list {
    display: grid;
    gap: 8px;
}

.wheel-option-pill {
    padding: 9px 11px;
    border-radius: 999px;
    background: var(--soft);
    font-size: 0.94rem;
}

.writing-output {
    white-space: pre-wrap;
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 650;
}

@media (max-width: 780px) {
    .result-table-header {
        display: none;
    }

    .result-table-header,
    .name-tag,
    .result-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .name-tag span,
    .result-row span,
    .name-tag .button,
    .result-row .button {
        justify-self: start;
    }

    .wheel-zone {
        grid-template-columns: 1fr;
    }
}


/* v0.7.0 local stats */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.stats-panel {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.stat-card {
    background: var(--soft);
    border-radius: 14px;
    padding: 14px;
}

.stat-card strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: 1.35rem;
}

.stat-card span {
    color: var(--muted);
}

.chart-bars {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.chart-row {
    display: grid;
    grid-template-columns: 74px 1fr 74px;
    gap: 10px;
    align-items: center;
}

.chart-label {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.chart-track {
    height: 16px;
    border-radius: 999px;
    background: #e6ebf5;
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #7c3aed);
    min-width: 2px;
}

.chart-value {
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.history-list {
    margin-top: 14px;
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.notice {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.94rem;
}

@media (max-width: 780px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-row {
        grid-template-columns: 58px 1fr 64px;
    }
}


/* v0.7.1 stats and wheel polish */
.result.hero-result {
    display: grid;
    place-items: center;
    text-align: center;
}

.result-summary {
    margin-top: 12px;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    color: var(--text);
}

.result-subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin-top: 4px;
}

.coin-disc.batch-done {
    background: radial-gradient(circle at 35% 30%, #ffffff, #dbeafe 42%, #2563eb 100%);
    border-color: #93c5fd;
    color: white;
}

.stats-panel h2 {
    margin-bottom: 18px;
}

.stat-card strong {
    font-variant-numeric: tabular-nums;
}

.quick-actions .button.secondary {
    min-width: 74px;
}

.wheel-tool-panel {
    overflow: hidden;
}

.wheel-spin-actions {
    margin: 18px 0 30px;
}

.wheel-zone {
    margin-top: 18px;
    grid-template-columns: minmax(300px, 430px) minmax(220px, 1fr);
    gap: 34px;
}

.wheel-pointer {
    margin: 0 auto 14px;
    border-top-color: #111827;
}

.wheel-wrap {
    margin-top: 0;
}

.wheel {
    width: min(340px, 78vw);
    height: min(340px, 78vw);
    margin: 0 auto;
}

.wheel-label {
    display: none;
}

.wheel-options-list {
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.wheel-option-pill {
    background: #eef4ff;
    border: 1px solid #dbe6ff;
}

.wheel-result {
    margin-top: 24px;
    padding: 16px 18px;
    font-size: 1.2rem;
}

@media (max-width: 780px) {
    .wheel-zone {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .wheel-options-list {
        max-height: none;
    }

    .wheel-spin-actions .button {
        width: 100%;
    }
}


/* v0.8.0 writing expansion and dice composite stats */
.stat-section-title {
    margin-top: 26px;
    margin-bottom: 8px;
}

.roll-history-item {
    padding: 9px 11px;
    border-radius: 12px;
    background: var(--soft);
    font-variant-numeric: tabular-nums;
}

.history-list.compact {
    max-height: 260px;
    overflow: auto;
}

.output-actions {
    margin-top: 14px;
}

.prompt-card {
    background: var(--soft);
    border-radius: 16px;
    padding: 18px;
    margin-top: 16px;
}

.prompt-card strong {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.generator-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.95rem;
}

.dice-composite-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}


/* v0.9.0 game visuals and card generators */
.dice-visual-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 12px;
}

.css-die {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(145deg, #f43f3f, #9f1111);
    border: 3px solid #7f1010;
    box-shadow: inset 0 7px 14px rgba(255,255,255,0.24), inset 0 -8px 15px rgba(0,0,0,0.24), 0 12px 24px rgba(153, 27, 27, 0.22);
    display: grid;
    grid-template-areas:
        "a . c"
        "e g f"
        "d . b";
    padding: 12px;
    gap: 4px;
}

.css-die.rolling {
    animation: diceShake 0.55s ease;
}

.die-pip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    align-self: center;
    justify-self: center;
}

.die-a { grid-area: a; }
.die-b { grid-area: b; }
.die-c { grid-area: c; }
.die-d { grid-area: d; }
.die-e { grid-area: e; }
.die-f { grid-area: f; }
.die-g { grid-area: g; }

.die-token {
    min-width: 78px;
    height: 78px;
    padding: 10px;
    clip-path: polygon(50% 0%, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
    background: linear-gradient(145deg, #f43f3f, #991b1b);
    color: white;
    display: grid;
    place-items: center;
    font-family: var(--display-font);
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-hand {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.playing-card {
    width: 96px;
    height: 136px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #d9deea;
    box-shadow: 0 14px 28px rgba(24, 32, 51, 0.16);
    position: relative;
    display: grid;
    place-items: center;
    font-family: var(--display-font);
    animation: dealCard 0.32s ease both;
}

.playing-card.red {
    color: #dc2626;
}

.playing-card.black {
    color: #111827;
}

.card-corner {
    position: absolute;
    font-size: 1rem;
    line-height: 1;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.card-corner.top {
    top: 10px;
    left: 10px;
}

.card-corner.bottom {
    bottom: 10px;
    right: 10px;
    transform: rotate(180deg);
}

.card-center {
    font-size: 3.1rem;
    line-height: 1;
}

.card-back {
    background: repeating-linear-gradient(45deg, #1d4ed8, #1d4ed8 8px, #2563eb 8px, #2563eb 16px);
    border: 6px solid white;
}

@keyframes dealCard {
    from { opacity: 0; transform: translateY(-18px) rotate(-4deg); }
    to { opacity: 1; transform: translateY(0) rotate(0); }
}

.hand-summary {
    text-align: center;
    margin-top: 14px;
}

.hand-summary strong {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.wheel-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 780px) {
    .playing-card {
        width: 76px;
        height: 108px;
        border-radius: 12px;
    }

    .card-center {
        font-size: 2.4rem;
    }

    .css-die {
        width: 58px;
        height: 58px;
        border-radius: 14px;
        padding: 9px;
    }

    .die-pip {
        width: 9px;
        height: 9px;
    }

    .wheel-template-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.9.1 stabilization polish */
.wheel-template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-panel .result:empty {
    display: none;
}

@media (max-width: 900px) {
    .wheel-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .wheel-template-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.9.2 generator history and statistics */
.history-panel {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.history-panel h2 {
    margin-bottom: 12px;
}

.history-actions {
    margin-top: 14px;
}

.mini-history-grid {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.mini-history-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 12px;
    background: var(--soft);
    color: var(--text);
}

.mini-history-item span {
    color: var(--muted);
}

.stat-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.94rem;
}


/* v0.9.3 dataset expansion */
.dataset-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--soft);
    color: var(--muted);
    font-size: 0.94rem;
}


/* v0.9.4 wrapping and batch action polish */
.mini-history-item {
    align-items: start;
    min-width: 0;
}

.mini-history-item strong,
.mini-history-item span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.mini-history-item strong {
    line-height: 1.45;
}

.mini-history-item span {
    text-align: right;
    flex: 0 0 auto;
}

.writing-output,
.result,
.prompt-card,
.name-tag,
.result-subtitle {
    overflow-wrap: anywhere;
    word-break: normal;
}

.batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 0;
}

.batch-actions .button.small,
.quick-actions .button.small {
    min-width: 68px;
}

@media (max-width: 640px) {
    .mini-history-item {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mini-history-item span {
        text-align: left;
    }
}


/* v0.9.5 statistics bucket and deck controls */
.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.checkbox-row {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--text);
}

.checkbox-row input {
    width: auto;
}

.deck-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

.bucket-grid {
    display: grid;
    gap: 18px;
}

.bucket-title {
    margin-top: 20px;
    margin-bottom: 8px;
}

.joker-card {
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
}

.joker-card .card-center {
    font-size: 2rem;
}


/* v0.9.6 simulation framework and records */
.probability-panel,
.records-panel,
.export-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.probability-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.probability-card {
    background: var(--soft);
    border-radius: 14px;
    padding: 12px;
}

.probability-card strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.rare-event {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7ed, #fee2e2);
    border: 1px solid #fed7aa;
    text-align: center;
}

.rare-event strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: clamp(1.35rem, 4vw, 2.4rem);
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 780px) {
    .probability-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.9.7 engine foundation and streak system */
.streak-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.streak-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.streak-card {
    background: var(--soft);
    border-radius: 14px;
    padding: 12px;
}

.streak-card strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

@media (max-width: 780px) {
    .streak-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.9.8 UI polish and wheel color sync */
.wheel-option-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #fff;
    border: 0;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12), 0 8px 18px rgba(15, 23, 42, 0.08);
}

.wheel-option-pill::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    flex: 0 0 auto;
}

.wheel-result.colored-result {
    color: #fff;
    border: 0;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.wheel-result.colored-result .result-subtitle {
    color: rgba(255,255,255,0.86);
}

.colored-history .mini-history-item {
    color: #fff;
    border: 0;
}

.colored-history .mini-history-item span {
    color: rgba(255,255,255,0.82);
}

.copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.result.copy-ready {
    position: relative;
}

.result .inline-copy {
    margin-top: 12px;
}

.good-result {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #86efac;
}

.rare-result {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.neutral-result {
    background: var(--soft);
}

@media (max-width: 780px) {
    .wheel-option-pill {
        min-height: 44px;
    }
}


/* v1.0.0 SEO architecture */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 28px auto 0;
    max-width: var(--page);
    padding: 0 22px;
    color: var(--muted);
    font-size: 0.95rem;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.category-hero {
    max-width: var(--page);
    margin: 0 auto;
    padding: 42px 22px 22px;
}

.category-hero h1 {
    margin-bottom: 10px;
}

.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.category-pill:hover {
    background: #dbeafe;
}

.faq-section {
    max-width: var(--page);
    margin: 28px auto;
    padding: 0 22px 44px;
}

.faq-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 16px;
}

.faq-item h3 {
    margin: 0 0 8px;
}

.featured-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.category-card {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.category-card strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: 1.25rem;
}

.category-card span {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.wheel-center,
[data-wheel-center] {
    cursor: pointer;
    user-select: none;
}

.wheel-center:focus,
[data-wheel-center]:focus {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 4px;
}

@media (max-width: 900px) {
    .featured-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .featured-category-grid {
        grid-template-columns: 1fr;
    }
}


/* v1.1.0 gaming expansion and stability */
.game-table {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.game-zone {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
}

.game-zone h2,
.game-zone h3 {
    margin-top: 0;
}

.community-row,
.hole-row,
.yahtzee-dice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}

.craps-point {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 74px;
    padding: 12px;
    border-radius: 999px;
    background: var(--soft);
    font-family: var(--display-font);
    font-size: 1.5rem;
    text-transform: uppercase;
}

.history-panel,
.mini-history-item,
.roll-history-item,
.name-tag,
.tool-card,
.faq-item,
.stat-card,
.streak-card,
.probability-card,
.playing-card,
.result,
.result-summary,
.result-subtitle {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.mini-history-item {
    align-items: flex-start;
}

.mini-history-item strong {
    flex: 1 1 auto;
}

.mini-history-item span {
    flex: 0 0 auto;
}

@media (max-width: 680px) {
    .mini-history-item {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mini-history-item span {
        text-align: left;
    }
}


/* v1.1.1 homepage layout hotfix */
.hero .tool-card,
.hero-card .tool-card {
    display: none;
}

.section .grid .tool-card {
    display: block;
}

.hero-card {
    align-self: start;
}

@media (min-width: 1000px) {
    .hero {
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
        align-items: center;
    }
}

.tool-card h3,
.category-card strong,
.hero-card-list .mini-row strong {
    overflow-wrap: anywhere;
}


/* v1.1.2 category layout hotfix */
.category-hero .tool-card,
.category-hero .grid {
    display: none;
}

.category-hero {
    overflow: visible;
}

.category-links {
    max-width: 100%;
    overflow: visible;
}

.category-links .tool-card {
    display: none;
}

.section .grid {
    align-items: stretch;
}


/* v1.1.3 UI consistency and statistics audit */
.chart-bars {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(160px, 2fr) max-content;
    gap: 14px;
    align-items: center;
}

.chart-label {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    color: var(--text);
    overflow-wrap: anywhere;
}

.chart-value {
    white-space: nowrap;
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.chart-track {
    min-width: 0;
    min-height: 14px;
    border-radius: 999px;
    background: #e8eef8;
    overflow: hidden;
}

.chart-fill {
    min-height: 14px;
    min-width: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #8b5cf6);
}

.related-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.related-card-grid a {
    display: block;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
}

.related-card-grid strong {
    display: block;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.related-card-grid span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.93rem;
}

.empty-state {
    padding: 14px;
    border-radius: 14px;
    background: var(--soft);
    color: var(--muted);
}

.badge-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    margin-top: 10px;
    background: var(--soft);
    font-weight: 900;
}

.badge-result.rare {
    background: #fef3c7;
    color: #92400e;
}

.badge-result.good {
    background: #dcfce7;
    color: #166534;
}

.help-list {
    border-radius: 18px;
}

@media (max-width: 860px) {
    .chart-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .chart-value {
        text-align: left;
    }

    .related-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .related-card-grid {
        grid-template-columns: 1fr;
    }
}


/* v1.1.4 category layout alignment */
:root {
    --content-narrow: 980px;
}

.category-hero,
.breadcrumbs,
.faq-section,
.section,
.footer-inner {
    width: min(var(--content-narrow), calc(100% - 44px));
    max-width: var(--content-narrow);
    margin-left: auto;
    margin-right: auto;
}

.category-hero,
.breadcrumbs,
.faq-section {
    padding-left: 0;
    padding-right: 0;
}

.category-hero {
    padding-top: 42px;
    padding-bottom: 24px;
}

.category-hero h1,
.category-hero .lead,
.category-hero .category-links {
    max-width: 760px;
}

.category-hero h1 {
    margin-bottom: 10px;
}

.category-links {
    gap: 10px;
}

.category-pill {
    min-height: 42px;
}

.section {
    padding-left: 0;
    padding-right: 0;
}

.category-hero + .section,
.section + .section {
    margin-top: 20px;
}

.section h2,
.faq-section h2 {
    max-width: 760px;
}

.section .grid {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    justify-content: start;
}

.section .grid .tool-card {
    min-height: 145px;
}

.faq-section {
    padding-bottom: 44px;
}

.faq-grid {
    width: 100%;
}

.site-footer {
    margin-top: 44px;
}

.footer-inner {
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 1000px) {
    .section .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .category-hero,
    .breadcrumbs,
    .faq-section,
    .section,
    .footer-inner {
        width: min(100% - 28px, var(--content-narrow));
    }

    .category-hero {
        padding-top: 28px;
    }
}
