html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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."
    }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: #fff4ce;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
    color: #111;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-left: 0.75rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

.info-page {
    display: grid;
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 8px;
}

.info-page__header {
    display: grid;
    gap: 10px;
}

.info-page__logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-page__logo img {
    width: 100%;
    max-width: 520px;
    height: auto;
    object-fit: contain;
    display: block;
}

.info-page__eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
}

.info-page__title {
    margin: 0;
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
}

.info-page__lede {
    margin: 0;
    max-width: 60ch;
    color: rgba(0, 0, 0, 0.62);
    line-height: 1.65;
}

.info-page__section {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.03);
}

.info-page__section h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.info-page__section p,
.info-page__section li,
.info-page__section dd {
    margin: 0;
    max-width: 65ch;
    color: rgba(0, 0, 0, 0.78);
    line-height: 1.65;
}

.info-page__list {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 10px;
}

.info-page__faq {
    margin: 0;
    display: grid;
    gap: 18px;
}

.info-page__faq-item {
    display: grid;
    gap: 6px;
}

.info-page__faq-item dt {
    margin: 0;
    font-weight: 700;
    color: #111;
}

.info-page__faq-item dd {
    margin: 0;
}

.site-footer {
    margin-top: 24px;
    padding: 18px 16px 28px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.site-footer__inner {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px 20px;
}

.site-footer__nav {
    display: flex;
    align-items: center;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.site-footer__nav a {
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.875rem;
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: #111;
    text-decoration: underline;
}

.site-footer__meta {
    margin: 0;
    color: rgba(0, 0, 0, 0.48);
    font-size: 0.8125rem;
    text-align: right;
}

.site-footer__social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-footer__support {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.site-footer__support img {
    height: 60px;
    width: 217px;
}

@media (max-width: 600px) {
    .site-footer__support img {
        height: 40px;
        width: auto;
    }
}

.site-footer__social a {
    display: inline-flex;
    align-items: center;
}

.site-footer__social-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.65;
    transition: opacity 0.15s ease;
    display: block;
}

.site-footer__social a:hover .site-footer__social-icon,
.site-footer__social a:focus-visible .site-footer__social-icon {
    opacity: 1;
}

@media (max-width: 640px) {
    .site-footer__inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .site-footer__nav {
        justify-content: center;
    }

    .site-footer__meta {
        text-align: center;
    }
}

.info-page__social {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.info-page__social-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(0, 0, 0, 0.78);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.info-page__social-link:hover,
.info-page__social-link:focus-visible {
    color: #111;
    text-decoration: underline;
}

.info-page__social-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.reveal-board {
    width: min(92vw, 68svh);
    max-width: min(92vw, 68svh);
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.reveal-board__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reveal-board__tiles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: grid;
    gap: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.reveal-tile {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    aspect-ratio: 1 / 1;
}

.reveal-tile--hidden {
    visibility: hidden;
}

.game-player__hud {
    width: 100%;
    max-width: min(92vw, 68svh);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.reveal-board-wrap {
    position: relative;
    width: 100%;
    max-width: min(92vw, 68svh);
}

@media (min-width: 900px) {
    .game-player__hud {
        max-width: 560px;
        gap: 12px;
    }

    .reveal-board-wrap {
        max-width: 560px;
    }

    .reveal-board {
        width: 100%;
        max-width: 560px;
    }
}

.reveal-budget-wrap {
    position: absolute;
    top: 8px;
    right: 8px;
}

.stage-selector {
    display: flex;
    gap: 8px;
}

.stage-selector__button {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.8);
    display: grid;
    place-items: center;
    padding: 0;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, opacity 120ms ease, background 120ms ease;
}

.stage-selector__button--active {
    border-color: #111;
    background: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15), 0 6px 14px rgba(0, 0, 0, 0.2);
}

.stage-selector__button--inactive {
    opacity: 0.45;
}

.stage-selector__button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.stage-selector__button:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stage-selector__button:disabled {
    opacity: 0.45;
    cursor: default;
}

.stage-selector__icon {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #111;
    display: block;
}

.stage-selector__button--active .stage-selector__icon {
    background: #fff;
}

.stage-selector__button--clue2 .stage-selector__icon {
    border-radius: 6px;
}

.stage-selector__button--answers .stage-selector__icon {
    border-radius: 2px;
}

.stage-selector__button--result .stage-selector__icon {
    border-radius: 4px;
    transform: rotate(45deg);
}

.reveal-budget {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    min-width: 72px;
}

.reveal-budget__hammer {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
}

.reveal-budget__count {
    font-size: 3rem;
    font-weight: 700;
    color: #111;
    min-width: 1.5ch;
    text-align: left;
}

.stage-advance {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: #111;
    display: grid;
    place-items: center;
    transition: transform 120ms ease, opacity 120ms ease;
    margin-top: 6px;
    align-self: center;
}

.stage-advance svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stage-advance:disabled {
    opacity: 0.35;
}

.stage-advance:not(:disabled) {
    animation: stage-advance-glow 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 rgba(17, 17, 17, 0.0);
}

@keyframes stage-advance-glow {
    0% {
        box-shadow: 0 0 0 rgba(17, 17, 17, 0.0);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 12px rgba(17, 17, 17, 0.35);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 rgba(17, 17, 17, 0.0);
        transform: scale(1);
    }
}

.result-overlay {
    width: min(92vw, 520px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
    align-items: center;
}

.result-overlay__selected {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
}

.result-overlay__selected img,
.result-overlay__correct img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-overlay__icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    display: grid;
    place-items: center;
}

.result-overlay__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.result-overlay__secondary {
    width: min(70%, 260px);
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    opacity: 0.9;
    outline: 2px solid rgba(0, 0, 0, 0.15);
    outline-offset: -2px;
}

.result-overlay__actions {
    display: flex;
    gap: 12px;
}

.result-overlay__action {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: #111;
    display: grid;
    place-items: center;
}

.result-overlay__action svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-panel {
    width: min(92vw, 520px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.share-panel__button {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: #111;
    display: grid;
    place-items: center;
}

.share-panel__button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- gameplay --- */
 .picker-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.board-stack {
    width: 100%;
    max-width: min(92vw, 68svh);
    margin: 0 auto;
}

.board-controls {
    width: 100%;
}

.controls-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.controls-row--picker {
    justify-content: center;
}

/* ── Reconnect modal (global; element is JS-created so Blazor scoped CSS cannot apply) ── */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    background-color: white;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    /* display/overlay discrete transitions are intentional for dialog top-layer close animations; some IDE CSS validators do not recognize these newer values yet. */
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity 0.5s both;

    &[open] {
        animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
        animation-fill-mode: both;
    }
}

#components-reconnect-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp {
    0% { transform: translateY(30px) scale(0.95); }
    100% { transform: translateY(0); }
}

@keyframes components-reconnect-modal-fadeInOpacity {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button {
    border: 0;
    background-color: #6b9ed2;
    color: white;
    padding: 4px 24px;
    border-radius: 4px;
}

    #components-reconnect-modal button:hover {
        background-color: #3b6ea2;
    }

    #components-reconnect-modal button:active {
        background-color: #6b9ed2;
    }

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
}

    .components-rejoining-animation div {
        position: absolute;
        border: 3px solid #0087ff;
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2) {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation {
    0% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    4.9% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    5% { top: 40px; left: 40px; width: 0; height: 0; opacity: 1; }
    100% { top: 0px; left: 0px; width: 80px; height: 80px; opacity: 0; }
}

.controls-row--nav {
    justify-content: space-between;
}

.picker-tray {
    display: flex;
    width: 100%;
    max-width: min(92vw, 68svh);
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    margin-top: 10px;
    margin-bottom: 8px;
}

.picker-tray::after {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.06);
    transform: translateX(-50%) rotate(45deg);
    box-shadow: -1px -1px 0 0 rgba(0, 0, 0, 0.04);
}

.reveal-board {
    position: relative;
    width: min(92vw, 68svh);
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
}

.reveal-board__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reveal-board__tiles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: grid;
    gap: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.reveal-tile {
    border-radius: 10px;
}

/* ─── puzzle nav chips (info pages) ─────────────────────────────── */
.puzzle-nav-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.puzzle-nav-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
    color: #333;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    touch-action: manipulation;
}

.puzzle-nav-chip:hover {
    background: rgba(0, 0, 0, 0.09);
}
