:root {
    /* Poker-felt palette. Used everywhere; change a value here and the whole
       app re-tints. CSS variables on :root cascade into scoped razor.css too. */
    --felt-green:        #0e5e3a;
    --felt-green-dark:   #083d24;
    --felt-green-light:  #3aa05f;

    /* Surfaces: warm cream that sits on the felt without fighting it. */
    --surface:           #f8f5ee;
    --surface-alt:       #efebdf;
    --surface-stripe:    #f3efe4;
    --surface-border:    #d9d3c2;

    --text:              #1a1a1a;
    --text-muted:        #5d5d5d;
    --text-faint:        #8a8a8a;

    --shadow-sm: 0 1px 2px rgba(8, 32, 20, 0.06);
    --shadow-md: 0 2px 10px rgba(8, 32, 20, 0.09);
    --shadow-lg: 0 12px 32px rgba(8, 32, 20, 0.18);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
}

html, body {
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    /* Soft felt mottle: two faint radial blobs over a cream base so the page
       reads "card table" without competing with the score table for attention. */
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(14, 94, 58, 0.06), transparent 60%),
        radial-gradient(1000px 500px at 85% 90%, rgba(14, 94, 58, 0.05), transparent 60%),
        var(--surface);
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

/* Page headings sit at felt-green-dark site-wide for consistency. Scoped
   .razor.css rules can still override per-page where needed (e.g. the
   Rules document uses lighter green for h3 subheadings). */
h1, h2, h3 {
    color: var(--felt-green-dark);
}

a, .btn-link {
    color: var(--felt-green);
}

.btn-primary {
    color: #fff;
    background-color: #0e5e3a;
    border-color: #083d24;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #3aa05f;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Boot-time dice loader. Lives inside #app and is replaced wholesale once
   Blazor mounts. A single die cycles 1 → 6 → 1 by toggling pip opacity
   with step-end timing, so faces snap rather than fade. */
.dice-loader {
    position: absolute;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
    width: 6rem;
    height: 6rem;
    background: linear-gradient(155deg, #ffffff 0%, #ececec 100%);
    border: 2px solid #1a1a1a;
    border-radius: 0.9rem;
    box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.18);
    /* 3x3 grid placing the seven canonical pip slots. */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    padding: 0.7rem;
}

.dice-pip {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: #1a1a1a;
    align-self: center;
    justify-self: center;
    /* Same duration + step-end on every pip so the faces flip in sync. */
    animation: 1.2s step-end infinite;
}

.pip-tl { grid-area: 1 / 1; animation-name: pip-corner-2plus; }
.pip-br { grid-area: 3 / 3; animation-name: pip-corner-2plus; }
.pip-tr { grid-area: 1 / 3; animation-name: pip-corner-4plus; }
.pip-bl { grid-area: 3 / 1; animation-name: pip-corner-4plus; }
.pip-ml { grid-area: 2 / 1; animation-name: pip-mid-6only; }
.pip-mr { grid-area: 2 / 3; animation-name: pip-mid-6only; }
.pip-c  { grid-area: 2 / 2; animation-name: pip-center-odd; }

/* Keyframe boundaries: f1 = 0%, f2 = 16.66%, f3 = 33.33%, f4 = 50%,
   f5 = 66.66%, f6 = 83.33%. step-end holds each value until the next
   keyframe, so pips snap on/off between faces. The 100% keyframe loops
   the cycle back to face 1. */
@keyframes pip-corner-2plus {
    0% { opacity: 0; }
    16.66% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes pip-corner-4plus {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes pip-mid-6only {
    0% { opacity: 0; }
    83.33% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes pip-center-odd {
    0% { opacity: 1; }
    16.66% { opacity: 0; }
    33.33% { opacity: 1; }
    50% { opacity: 0; }
    66.66% { opacity: 1; }
    83.33% { opacity: 0; }
    100% { opacity: 1; }
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 7rem) 0 auto 0;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Shared action button — used across multiple components/pages */
.action-btn {
    padding: 9px 18px;
    font-size: 1rem;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    cursor: pointer;
    border-radius: var(--radius-pill);
    color: var(--text);
    text-decoration: none;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}

.action-btn:hover:not(:disabled) {
    background: var(--surface-alt);
    box-shadow: var(--shadow-md);
}

.action-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.action-btn:disabled {
    color: var(--text-faint);
    cursor: default;
    opacity: 0.55;
    box-shadow: none;
}

.action-btn.small {
    padding: 5px 12px;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: var(--felt-green);
    color: white;
    border-color: var(--felt-green-dark);
}

.action-btn.primary:hover:not(:disabled) {
    background: var(--felt-green-dark);
}