:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #101010;
    color: #f7f7f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: #101010;
}

button,
input {
    font: inherit;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.topbar,
.rollbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #171717;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rollbar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
}

.brand,
.total {
    color: #ffd54f;
    font-weight: 800;
}

.brand {
    font-size: 1.55rem;
    margin-right: auto;
}

.shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 0;
}

.sidebar {
    padding: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #121212;
}

h1,
h2 {
    margin: 0 0 12px;
}

h1 {
    font-size: 1.25rem;
}

h2 {
    font-size: 1rem;
}

.dice-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.board {
    padding: 24px;
    min-width: 0;
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 12px;
    align-content: start;
}

.die-card {
    min-height: 96px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.die-shape {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #101010;
    font-weight: 800;
    user-select: none;
}

.die-d6 {
    border-radius: 8px;
}

.die-frozen {
    opacity: 0.55;
    outline: 2px solid #ffd54f;
}

.hint {
    color: rgba(255, 255, 255, 0.62);
}

.button,
.chip {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #f7f7f7;
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
}

.button {
    border-radius: 8px;
    min-height: 42px;
    font-weight: 700;
}

.button.primary {
    background: #ffd54f;
    color: #101010;
    border-color: #ffd54f;
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.history {
    max-height: 220px;
    overflow: auto;
    display: grid;
    gap: 8px;
}

.record {
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.record strong {
    color: #ffd54f;
}

.field-row {
    display: flex;
    gap: 8px;
}

.field-row input {
    min-width: 0;
    flex: 1;
    background: #202020;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 10px 12px;
}

.roll-summary {
    flex: 1;
}

@media (max-width: 760px) {
    .topbar,
    .rollbar {
        flex-wrap: wrap;
    }

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

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}
