@font-face {
    font-family: 'Market Fresh';
    src: url('assets/fonts/MarketFresh.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html, body {
    background: linear-gradient(90deg, #201C3A, #8E5CFF); /* Purple background */
    font-family: 'Market Fresh', sans-serif;
    color: white;
    margin: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

h1 {
    font-weight: 700;
    font-size: 2.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Paragraph */
p {
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto 2rem auto;
    color: var(--dark);
    opacity: 0.85;
}

a {

}

th {
    color: #FCCC79;
}

td {
    color: white;
}

a:hover {
    color: #FACC78
}

.card {
    background-color: #ffffff52;
}

/* Call to action button */
.btn-primary {
    background: linear-gradient(90deg, #7b3cff, #ffb347);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 700;
    padding: 0.85rem 2.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
    align-content: center;
}

    .btn-primary:hover {
        background: linear-gradient(90deg, #6a32e1, #ff9f00);
    }

.btn-secondary {
    background: linear-gradient(90deg, #9370E0, #2E2956);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 700;
    padding: 0.85rem 2.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .btn-secondary:hover {
        background: linear-gradient(90deg, #8E5CFF, #201C3B);
    }

main, .content, article {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    margin-top: 10px;
}

#app, .app-root {
    min-height: 100vh; /* fallback for environments where 100% height isn't propagated */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.top-navbar {
    flex: 0 0 auto; /* don’t let it expand or center */
}

/* Links and buttons */
a, .btn-link {
    color: #00b8ff;
    text-decoration: none;
}

    a:hover, .btn-link:hover {
        color: #ffffff;
        text-decoration: underline;
    }


.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;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.page-transition-root {
    /* default transition properties (duration/delay overridden by CSS vars) */
    transition: opacity var(--pt-duration, 320ms) ease var(--pt-delay, 0ms), transform var(--pt-duration, 320ms) ease var(--pt-delay, 0ms);
    will-change: opacity, transform;
}

    /* Hidden initial state */
    .page-transition-root.initial {
        opacity: 0;
        transform: translateY(12px); /* slide up into place */
        visibility: hidden;
        pointer-events: none;
    }

    /* Visible state that triggers the transition */
    .page-transition-root.enter {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }

    /* Responsive spacing for mobile CTA */
    @media (max-width:520px) {
        .hero h1 {
            font-size: 1.3rem;
        }

        .btn {
            padding: 10px 12px;
        }
    }


/* Error boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYg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zLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

label {
    display: inline-block;
    color: black;
}
.modal-content {
    margin-top: 100px;
}

.modal-content p {
    color: black;
}

.text-muted {
    color: #FCCD78 !important;
}

footer {
    margin-top: auto;
    width: 100%;
    background-color: #4b0082;
    color: var(--dark);
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
    flex-shrink: 0;
    font-size: 0.9rem;
    opacity: 0.5;
}
@media (max-width: 992px) {
    /* Ensure hamburger is visible and on top */
    .hamburger {
        display: flex !important; /* show on smaller screens */
        position: relative; /* or absolute if you need it positioned */
        z-index: 1200 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

        /* Ensure the bars are visible, and not overwritten */
        .hamburger div {
            background-color: white !important;
            height: 3px;
        }

    /* If a parent uses overflow:hidden, move it above the flow */
    .top-navbar {
        overflow: visible;
    }

    /* hide wide nav links on small screens */
    .navbar-left .nav-link,
    .navbar-right .nav-link {
        display: none !important;
    }

    /* shrink logo */
    .site-logo img {
        width: 36px;
        height: 36px;
    }
}

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

@media (min-width: 900px) {
    .community-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
}


.modal-dialog {
    max-width: 95%; /* shrink on mobile */
    margin: 1.75rem auto;
}
.admin-section .d-flex {
    flex-wrap: wrap; /* allow items to wrap on small screens */
    gap: 0.5rem; /* spacing between items */
}

.admin-section input,
.admin-section button {
    flex: 1 1 auto; /* grow/shrink with available space */
    min-width: 150px; /* optional: prevent too small on mobile */
}
.admin-section table {
    width: 100%;
    display: block;
    overflow-x: auto;
}
.admin-section .table-responsive {
    overflow-x: auto;
}
@media (max-width: 576px) {
    .admin-section .d-flex > * {
        flex: 1 1 100%; /* stack items vertically on small devices */
        margin-bottom: 0.5rem;
    }
}

/* === Responsive admin improvements - paste at end of global CSS === */

/* Consistent box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent legacy overflow issues */
html, body {
    min-width: 0;
}

/* Admin container */
.admin-section {
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

    .admin-section .d-flex {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap; /* allow wrap on small screens */
    }

    /* Form controls/buttons flexibility */
    .admin-section input,
    .admin-section select,
    .admin-section button,
    .admin-section .form-control,
    .admin-section .form-select {
        flex: 1 1 auto;
        min-width: 140px;
        max-width: 100%;
    }

/* Table responsive wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Keep tables readable - let user scroll horizontally */
.admin-section table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px; /* change this down if you prefer */
    display: table;
}

/* Make table content wrap when useful */
.admin-section th,
.admin-section td {
    white-space: normal;
    word-break: break-word;
    padding: 0.45rem 0.6rem;
}

/* Smaller table font on very small screens */
@media (max-width: 420px) {
    .admin-section th, .admin-section td {
        font-size: 0.85rem;
        padding: 0.35rem 0.45rem;
    }
}

/* Button sizing to avoid overflow */
.btn-primary, .btn-secondary, .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btn-primary, .btn-secondary, .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.92rem;
    }
}

@media (max-width: 520px) {
    .btn-primary, .btn-secondary, .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.88rem;
    }

    .hero h1 {
        font-size: 1.3rem;
    }
}

/* Modal tweaks */
.modal-dialog {
    margin: 0.75rem auto;
    max-width: 96%;
    width: calc(100% - 1.5rem);
}

.modal-content {
    margin-top: 1rem;
    overflow: hidden;
}

.modal-body {
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content .form-control, .modal-content .form-select, .modal-content textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Avoid overall page horizontal scrolling but allow specific wrappers to scroll */
body, html {
    overflow-x: hidden;
}

    body .table-responsive {
        overflow-x: auto;
    }

/* small screens: stack pagination controls */
@media (max-width: 420px) {
    .admin-section .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
}

/* Make code / token fields more forgiving */
.admin-section td code {
    white-space: break-spaces;
    word-break: break-all;
}

/* Optional: scrollbar height hint for scrollable tables on webkit */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    border-radius: 6px;
}


/* ===== Fix flex/min-width overflow and make tables truly responsive ===== */

/* 1) Allow flex children to shrink properly.
   Without this, flex items keep their intrinsic min-width and force the page to stop shrinking. */
.admin-section,
.admin-section .card,
.admin-section .d-flex,
.admin-section .d-flex > *,
.admin-section .table-responsive {
    min-width: 0; /* critical for flex layouts */
}

/* 2) Ensure responsive wrapper scrolls horizontally,
     and the table inside may be wider than the container (so it will scroll). */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    /* Let the table have a reasonable intrinsic min-width (prevents crushing long content),
   while still allowing the wrapper to scroll instead of making the whole page overflow. */
    .table-responsive table {
        width: 100%;
        border-collapse: collapse;
        min-width: 640px; /* keeps columns readable — adjust (520px) if you need smaller */
        table-layout: auto;
    }

/* Remove conflicting earlier rule that set table to display:block (if present) */
.admin-section table {
    display: table;
    max-width: 100%;
}

/* Make table cells wrap without forcing width on the page */
.admin-section th,
.admin-section td {
    white-space: normal;
    word-break: break-word;
    padding: 0.45rem 0.6rem;
}

/* 3) Buttons/inputs: ensure they can shrink inside flex parents */
.admin-section input,
.admin-section select,
.admin-section button,
.admin-section .form-control,
.admin-section .form-select {
    min-width: 0; /* let them shrink if needed */
}

/* 4) Modal & small-screen niceties (keeps modal usable) */
.modal-dialog {
    max-width: 96%;
    margin: 0.75rem auto;
    width: calc(100% - 1.5rem);
}

.modal-body {
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 5) Optional: comment out global overflow-x:hidden while debugging
   (if you previously set overflow-x: hidden on body/html, it hides the scrollbars
    for the table wrapper and makes debugging confusing). */
/* body, html { overflow-x: hidden; }  <-- comment out while testing */

/* 6) Narrower min-width option for very small screens:
   If you prefer the table to require less horizontal space, change the min-width above to 520px. */


/* =================== Force-responsive overrides - paste at END of file =================== */

/* 1) Allow all flex children to actually shrink (critical) */
.admin-section,
.admin-section * {
    min-width: 0 !important; /* prevents intrinsic min-width from blocking shrink */
    box-sizing: border-box; /* consistent sizing */
}

    /* 2) Ensure cards and d-flex containers don't force the viewport width */
    .admin-section .card,
    .admin-section .d-flex,
    .admin-section .d-flex > * {
        min-width: 0 !important;
    }

    /* 3) Reset earlier 'display:block' table hack if present and make table obey container width */
    .admin-section table {
        display: table !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; /* allow it to shrink inside .table-responsive */
        table-layout: auto;
    }

/* 4) Make the responsive wrapper provide the horizontal scrolling area */
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}


/* Search area: stack on xs */
.search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}
/* Desktop: taller cover */
@media (min-width: 768px) {
    .game-cover {
        height: 200px;
    }
}

/* Mobile: keep a pleasant aspect ratio */
@media (max-width: 767.98px) {
    .game-cover {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

        .search-row .form-control {
            width: 100% !important;
        }

        .search-row .btn {
            width: 100%;
        }
}

@media (max-width: 576px) {
    .card.h-100 {
        min-height: 220px;
    }
}

@media (min-width: 768px) {
    .game-top {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .cover-wrapper {
        width: 320px;
    }
}

@media (min-width: 992px) {
    .game-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}
/* Small typography adjustments for tiny screens */
@media (max-width: 360px) {
    h2 {
        font-size: 1.15rem;
    }

    .cover-placeholder {
        height: 150px;
    }
}

@media (max-width: 900px) {
    .community-grid {
        grid-template-columns: 1fr !important;
    }

    /* Put Quest Board ABOVE Tavern on small screens */
    .right-side {
        order: -1;
    }

    /* Optional: make tavern card full width */
    .tavern-card {
        width: 100%;
        max-width: 100%;
    }
}

.chat-fab {
    position: fixed;
    bottom: 60px;
    right: 24px;
    background: #4b0082;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 2000;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.chat-popup {
    position: fixed;
    bottom: 60px;
    right: 24px;
    width: 320px;
    height: 420px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    z-index: 2000;
}

.chat-popup-header {
    padding: 10px;
    background: #4b0082;
    color: white;
    display: flex;
    justify-content: space-between;
    border-radius: 10px 10px 0 0;
}

.chat-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #f7f8ff;
}

.msg {
    margin-bottom: 8px;
    color: black;
}

    .msg.me {
        text-align: right;
    }

    .msg.other {
        text-align: left;
    }

.chat-popup-input {
    display: flex;
    padding: 8px;
    border-top: 1px solid #ccc;
}

    .chat-popup-input input {
        flex: 1;
        padding: 6px;
    }


@media (max-width: 576px) {
    .list-card {
        flex-direction: column;
        align-items: flex-start !important;
    }

        .list-card div:last-child {
            margin-top: 10px;
            width: 100%;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
}