:root { color-scheme: dark; }

body {
    font-family: "Courier New", ui-monospace, monospace;
    margin: 0;
    background: #0f0f1a;
    color: #e8e8f0;
    line-height: 1.5;
}

header .nav-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #1a1a2e;
    border-bottom: 2px solid #e94560;
}
header .nav-container a.brand { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
header .nav-container a.brand img { height: 44px; width: auto; display: block; }

header .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}
header .nav-links a { color: #7cc8ff; text-decoration: none; }
header .nav-links .spacer { flex: 1; }
header .nav-links form.inline { display: inline; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #e8e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    header .nav-container a.brand img { height: 36px; }
    header .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        margin-top: 1rem;
        gap: 0.75rem;
    }
    header .nav-links.open {
        display: flex;
    }
    header .nav-links .spacer {
        display: none;
    }
}

main { padding: 1.5rem; }
footer { padding: 1rem 1.5rem; color: #888; }

.hero h1 { font-size: 2.5rem; margin-bottom: .25rem; }
.hero-tagline { font-size: 1.35rem; font-weight: bold; color: #ffb86c; margin: .2rem 0 .4rem; max-width: 46rem; }
.hero-sub { color: #c7c7da; margin: 0 0 1rem; max-width: 46rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }
.hero-note { color: #9a9ab0; font-size: .85rem; max-width: 46rem; }
/* Green "play" look without the .emu-play click wiring (e.g. a link that jumps to the shelf). */
.btn.btn-play { background: #7cffa0; color: #0f0f1a; font-weight: bold; }
.btn.btn-play:hover { background: #5be084; }

/* "Play free in your browser" shelf on the home page. */
.play-free {
    margin: 1.5rem 0 2rem; padding: 1rem 1.2rem 1.2rem;
    background: #12201a; border: 1px solid #1f4a2f; border-radius: 10px;
    scroll-margin-top: 1rem;
}
.play-free h2 { margin: 0 0 .2rem; color: #7cffa0; }
.play-free > .meta { margin: 0 0 1rem; color: #9a9ab0; }
.filters .filter-play { color: #7cffa0; }
.btn-youtube { background: #ff0000; }
.btn-youtube:hover { background: #cc0000; }
.btn {
    display: inline-block;
    padding: .6rem 1.2rem;
    background: #e94560;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.filters { display: flex; gap: .75rem; margin: 1rem 0; }

.game-grid {
    list-style: none;
    display: grid;
    /* Fit as many cards per row as the viewport allows (no column cap), a bit larger
       than before, reflowing down to fewer columns then 1 on narrow screens.
       min(100%, …) prevents overflow on phones. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    padding: 0;
}
.game-grid li { border: 2px solid #e94560; padding: 1rem; border-radius: 6px; overflow: hidden; }
.game-grid .meta { color: #9a9ab0; font-size: .85rem; }
.game-grid .price { color: #7cffa0; font-weight: bold; }
/* listing thumbnail: flush to the card's top edges */
.game-grid .card-img-link { display: block; margin: -1rem -1rem .75rem; }
.game-grid .card-img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    display: block; border-radius: 4px 4px 0 0;
}

/* --- available subscription plans (catalog + home) --- */
.plans-section { margin-top: 2.5rem; }
.plans-section h2 { margin-bottom: .25rem; }
.plans-intro { color: #9a9ab0; margin-top: 0; }
.plan-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
    padding: 0;
    max-width: 1120px;
}
.plan-card {
    display: flex; flex-direction: column;
    border: 2px solid #7cc8ff; border-radius: 6px; padding: 1.1rem;
    background: #14142a;
}
.plan-card h3 { margin: 0 0 .4rem; color: #7cc8ff; }
.plan-card .plan-desc { color: #cfcfe0; font-size: .9rem; margin: 0 0 .5rem; }
.plan-card .plan-unlocks { color: #9a9ab0; font-size: .85rem; margin: 0 0 .5rem; }
.plan-card .plan-price { color: #7cffa0; font-weight: bold; font-size: 1.3rem; margin: .2rem 0 .9rem; }
.plan-card .plan-price .per { color: #9a9ab0; font-weight: normal; font-size: .8rem; }
/* push the buy action to the bottom so uneven cards line up */
.plan-card .buy { margin-top: auto; }
.plan-card .buy .btn { display: inline-block; border: 0; cursor: pointer; font: inherit; }

table { border-collapse: collapse; width: 100%; max-width: 640px; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid #2a2a40; }

.stats { list-style: none; padding: 0; }
.stats li { padding: .25rem 0; }

/* --- admin: customer purchases --- */
.purchases { max-width: 1200px; }
.purchases th, .purchases td { vertical-align: top; }
.purchases .num { text-align: right; white-space: nowrap; }
.purchases .cust-email { font-weight: bold; color: #7cc8ff; overflow-wrap: anywhere; }
.purchases .cust-total { color: #e8e8f0; }
.purchases .cust-net { color: #7cffa0; font-weight: bold; }
.purchases .nowrap { white-space: nowrap; }
.purchases .bought { list-style: none; margin: 0; padding: 0; }
.purchases .bought li { padding: .1rem 0; }
.purchases .bought .meta { color: #9a9ab0; font-size: .8rem; margin-left: .4rem; }

/* --- refund / cancel controls, status badges, banners --- */
.status-banner {
    background: #223; border-left: 4px solid #7cc8ff; color: #dfe6ff;
    padding: .7rem 1rem; border-radius: 4px; margin: 1rem 0; max-width: 800px;
}
.badge {
    display: inline-block; padding: .15rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: bold; white-space: nowrap;
}
.badge-ok { background: #1f4a2f; color: #7cffa0; }
.badge-pending { background: #4a3f1f; color: #ffd479; }
.badge-beta { background: #3a2f14; color: #ffb86c; }
.badge-demo { background: #1f4a2f; color: #7cffa0; }
.inline-form { display: inline; margin-left: .4rem; }
.badge-refunded { background: #4a1f27; color: #ff9aa8; }
.btn-danger { background: #b3283f; }
.btn-danger:hover { background: #8f1e32; }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.refund-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.refund-form .refund-reason {
    padding: .3rem .5rem; border-radius: 4px; border: 1px solid #444; max-width: 11rem;
}
.refund-form button, .cancel-form button { border: 0; cursor: pointer; font: inherit; }

/* pager */
.pager { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0; }
.pager .pager-pos { color: #9a9ab0; }
.pager .btn.disabled { background: #4a4a5a; cursor: not-allowed; pointer-events: none; opacity: .6; }

.featured-star { color: #ffb86c; font-weight: bold; white-space: nowrap; }

/* --- visitor counters --- */
.counters { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 .5rem; }
.counter {
    display: flex; flex-direction: column; gap: .2rem;
    min-width: 130px; padding: .9rem 1.1rem;
    border: 1px solid #2a2a40; border-left: 4px solid #7cc8ff; border-radius: 6px;
    background: #14142a;
}
.counter .n { font-size: 1.8rem; font-weight: bold; color: #7cffa0; line-height: 1; }
.counter .label { color: #9a9ab0; font-size: .8rem; }

/* --- site visibility toggle --- */
.site-mode {
    border: 1px solid #2a2a40; border-left-width: 4px;
    border-radius: 6px; padding: .8rem 1.1rem; margin: 1rem 0 1.5rem; max-width: 640px;
}
.site-mode.is-construction { border-left-color: #ffb86c; }
.site-mode.is-live { border-left-color: #7cffa0; }
.site-mode h2 { margin-top: 0; }
.toggle-form { display: flex; align-items: center; gap: 1rem; margin-top: .8rem; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 42px; height: 22px; border-radius: 22px; background: #2a2a40;
    position: relative; transition: background .15s;
}
.switch .track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%; background: #e8e8f0; transition: transform .15s;
}
.switch input:checked + .track { background: #ffb86c; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid #7cc8ff; outline-offset: 2px; }

/* --- admin forms --- */
.admin-form { display: flex; flex-direction: column; gap: .35rem; max-width: 520px; }
.admin-form label { margin-top: .6rem; color: #9a9ab0; font-size: .85rem; }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form textarea,
.admin-form select {
    background: #1a1a2e;
    color: #e8e8f0;
    border: 1px solid #2a2a40;
    border-radius: 4px;
    padding: .45rem .6rem;
    font: inherit;
}
.admin-form label.checkbox { display: flex; align-items: center; gap: .5rem; color: #e8e8f0; }
.admin-form fieldset { display: flex; flex-direction: column; gap: .35rem; border: 1px solid #2a2a40; border-radius: 4px; margin-top: .8rem; padding: .6rem .8rem; }
.admin-form fieldset legend { color: #9a9ab0; font-size: .85rem; padding: 0 .3rem; }
.admin-form .actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.admin-form button.btn { border: 0; cursor: pointer; font: inherit; }
.admin-form button.btn:disabled { background: #4a4a5a; cursor: not-allowed; }

.error { color: #ff6b81; font-size: .85rem; }
.warn { color: #ffb86c; }
.status { color: #7cffa0; border-left: 3px solid #7cffa0; padding-left: .6rem; }
.status-error { color: #ff6b81; border-left: 3px solid #ff6b81; padding-left: .6rem; }
.admin-form .field-hint { color: #8a8aa0; font-size: .78rem; margin: .1rem 0 0; }

/* --- asset manager --- */
.search-row { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; }
.search-row input[type="search"] {
    flex: 1; max-width: 420px;
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .45rem .6rem; font: inherit;
}
.copy-row { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
.copy-row input {
    flex: 1; max-width: 480px;
    background: #0f0f1a; color: #7cc8ff; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .45rem .6rem; font: inherit;
}

dl dt { color: #9a9ab0; font-size: .85rem; margin-top: .5rem; }
dl dd { margin: 0; }

/* --- admin media manager --- */
.media-list { list-style: none; padding: 0; max-width: 720px; }
.media-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid #2a2a40;
}
.media-list .thumb { width: 120px; height: 68px; object-fit: cover; border: 1px solid #2a2a40; border-radius: 4px; }
.media-list .media-meta { flex: 1; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.media-list .media-meta small { overflow-wrap: anywhere; }
.media-list .media-actions { display: flex; gap: .3rem; }
.media-list .media-actions form { display: inline; }
.media-list .media-actions button {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .3rem .5rem; cursor: pointer; font: inherit;
}
.media-list .media-actions button:disabled { opacity: .4; cursor: not-allowed; }
.media-list .media-actions button.danger { border-color: #e94560; color: #ff6b81; }

/* per-deliverable public link + download tally on the deliverables page */
.media-list .downloads-count { color: #7cffa0; }
.media-list .public-link { display: flex; flex-direction: column; gap: .15rem; margin-top: .2rem; }
.media-list .public-link label { color: #9a9ab0; font-size: .8rem; }
.media-list .public-link input {
    background: #12121f; color: #7cc8ff; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .3rem .5rem; font: inherit; font-size: .85rem;
}

/* replace-file-in-place control on each deliverable row */
.media-list .replace-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .2rem; }
.media-list .replace-form input[type="file"] { font-size: .85rem; min-width: 0; }
.media-list .replace-form button {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .35rem .6rem; cursor: pointer; font: inherit;
}

/* admin games search box */
.games-search { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.games-search input[type="search"] {
    flex: 1; min-width: 220px; max-width: 420px;
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .5rem .7rem; font: inherit;
}

/* sortable column headers on the admin games list */
table thead th a { color: #cfcfe0; text-decoration: none; white-space: nowrap; }
table thead th a:hover { color: #7cc8ff; text-decoration: underline; }

/* admin gifting */
.gift-pass-form select, .gift-pass-form input[type="number"] {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .45rem .6rem; font: inherit;
}
.gift-pass-form input[type="number"] { width: 6rem; }
.gift-games {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: .3rem .9rem; max-height: 420px; overflow: auto;
    border: 1px solid #2a2a40; border-radius: 6px; padding: .7rem; margin: .5rem 0;
}
.gift-game { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.gift-game .gift-game-title { color: #e8e8f0; }
.gift-game.unavailable { opacity: .55; }

/* inline caption editing on each media row */
.media-list .caption-form { display: flex; gap: .4rem; align-items: center; }
.media-list .caption-form input[type="text"] {
    flex: 1; min-width: 0;
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .35rem .5rem; font: inherit;
}
.media-list .caption-form button {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .35rem .6rem; cursor: pointer; font: inherit;
}

/* --- repeatable media rows on the create form --- */
.media-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto;
    gap: .4rem;
    align-items: center;
    margin-bottom: .4rem;
}
.media-row .error { grid-column: 1 / -1; }
.media-row input {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .45rem .6rem; font: inherit;
}
.media-row button[data-remove] {
    background: transparent; color: #ff6b81; border: 1px solid #2a2a40;
    border-radius: 4px; padding: .35rem .6rem; cursor: pointer; font: inherit; line-height: 1;
}
.btn-secondary {
    background: transparent; color: #7cc8ff; border: 1px dashed #2a2a40;
    border-radius: 4px; padding: .4rem .8rem; cursor: pointer; font: inherit;
    margin-top: .3rem;
}
fieldset small.meta { display: block; margin-top: .5rem; }

/* --- public game detail --- */
.game-detail { max-width: 900px; }
.game-detail h2 { margin-top: 2rem; }
/* show the description exactly as typed (keep the admin's line breaks) */
.game-description { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1rem 0; }
.buy { margin: 1rem 0 1.5rem; }
/* The demo player's "Get the full game" lands here — keep the title + price in view above it. */
#buy { scroll-margin-top: 7rem; }
.buy .buy-btn { border: 0; cursor: pointer; font: inherit; }
.buy.owned { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.owned-badge { color: #7cffa0; font-weight: bold; }
.free-hint { color: #ffb86c; margin: -.5rem 0 1.5rem; }

/* --- My games / downloads --- */
.library-head { margin-bottom: 1.1rem; }
.library-head h1 { margin: 0 0 .15rem; }

/* Responsive card grid */
.library {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem; max-width: 1100px;
}
.library-card {
    display: flex; flex-direction: column;
    background: #16162a; border: 1px solid #23233a; border-radius: 12px; overflow: hidden;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.library-card:hover { transform: translateY(-3px); border-color: #352a5e; box-shadow: 0 8px 22px rgba(0,0,0,.4); }

.library-cover { position: relative; display: block; aspect-ratio: 16 / 10; background: #0f0f1a; overflow: hidden; }
.library-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-cover-placeholder {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    color: #6a6a8a; font-weight: bold; font-size: 1.3rem; letter-spacing: .05em;
    background: linear-gradient(135deg, #16162a, #1a1430);
}
.library-badge { position: absolute; top: .55rem; right: .55rem; margin: 0; backdrop-filter: blur(2px); background: rgba(15,15,26,.65); }

.library-body { display: flex; flex-direction: column; gap: .35rem; padding: .85rem 1rem 1rem; flex: 1; }
.library-title { margin: 0; font-size: 1.05rem; line-height: 1.3; }

.library-downloads { margin-top: auto; padding-top: .6rem; }
.library-downloads h4 {
    margin: 0 0 .4rem; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .06em; color: #9a9ab0;
}
.library-no-downloads { margin: .4rem 0 0; }

.tag {
    display: inline-block; padding: .1rem .55rem; vertical-align: middle;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
    border: 1px solid #7cc8ff; color: #7cc8ff; border-radius: 999px;
}
.tag-owned { border-color: #7cffa0; color: #7cffa0; }
.tag-beta { border-color: #ffb86c; color: #ffb86c; margin-left: .4rem; }

.downloads { list-style: none; padding: 0; margin: .5rem 0 0; }
.downloads li { padding: .15rem 0; }
.downloads a { color: #7cffa0; }

/* Download chips inside a library card */
.library-downloads .downloads { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.library-downloads .downloads li { padding: 0; }
.library-downloads .downloads a {
    display: inline-block; padding: .3rem .6rem; border: 1px solid #2a4a38;
    background: #13251c; border-radius: 6px; font-size: .85rem; line-height: 1;
}
.library-downloads .downloads a:hover { border-color: #7cffa0; background: #16301f; }

.library-foot { margin: .7rem 0 0; }

/* Empty state */
.library-empty {
    text-align: center; max-width: 420px; margin: 2rem auto;
    padding: 2rem 1.5rem; border: 1px dashed #352a5e; border-radius: 12px; background: #16162a;
}
.library-empty-icon { font-size: 2.4rem; margin: 0 0 .4rem; }
.library-empty p { margin: .3rem 0 1rem; }

.downloads-section { max-width: 520px; margin-top: 1.5rem; }
.downloads-section h2 { margin-bottom: .5rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; border: 2px solid #2a2a40; border-radius: 6px; display: block; }
/* clickable thumbnail: reset the button chrome so it looks like the image alone */
.shot-thumb { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot-thumb:focus-visible { outline: 2px solid #7cc8ff; outline-offset: 2px; }

/* --- screenshot lightbox --- */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .88); padding: 2rem;
}
.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-figure {
    margin: 0; max-width: 92vw; max-height: 88vh;
    display: flex; flex-direction: column; align-items: center;
}
.lb-image {
    max-width: 92vw; max-height: 82vh; object-fit: contain;
    border: 2px solid #2a2a40; border-radius: 6px; background: #0f0f1a;
}
.lb-caption { color: #e8e8f0; padding-top: .6rem; text-align: center; max-width: 92vw; }
.lb-caption[hidden] { display: none; }
.lb-close, .lb-nav {
    position: absolute; background: rgba(26, 26, 46, .85); color: #e8e8f0;
    border: 1px solid #2a2a40; border-radius: 6px; cursor: pointer;
    line-height: 1; font: inherit;
}
.lb-close { top: 1rem; right: 1rem; font-size: 1.8rem; padding: .1rem .6rem; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 2.4rem; padding: .1rem .8rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-close:hover, .lb-nav:hover, .lb-close:focus-visible, .lb-nav:focus-visible {
    border-color: #e94560; color: #fff; outline: none;
}
.gallery figcaption,
.videos figcaption { color: #9a9ab0; font-size: .85rem; padding-top: .4rem; }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.videos figure { margin: 0; }
/* 16:9 box so the iframe scales with the column instead of overflowing it. */
.video-frame { position: relative; padding-top: 56.25%; }
.video-frame iframe {
    position: absolute; inset: 0; width: 100%; height: 100%;
    border: 0; border-radius: 6px;
}

/* --- game star-rating widget --- */
.rating-section { max-width: 520px; margin-top: 1.5rem; }
.rating-section h2 { margin-bottom: .6rem; }

.rating-widget {
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    margin-bottom: .6rem;
}

.rating-stars { display: flex; gap: .15rem; }
.star-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.8rem; line-height: 1; padding: .1rem;
    color: #3a3a50; transition: color .12s, transform .12s;
}
.star-btn:disabled { cursor: default; }
.star-btn.voted { color: #ffb86c; }
.star-btn.hover { color: #ffd479; transform: scale(1.15); }
.star-btn.active { color: #ffb86c; text-shadow: 0 0 6px rgba(255, 184, 108, .5); }

.rating-avg { color: #ffd479; font-weight: bold; font-size: 1.1rem; }
.rating-total { color: #9a9ab0; font-size: .85rem; }
.game-card-rating { color: #ffd479; font-size: .9rem; margin: .35rem 0; }
.game-card-rating-count, .game-card-rating-empty { color: #9a9ab0; }

/* "Updated YYYY-MM-DD" freshness line on cards and the detail page. */
.game-card-updated { color: #7cffa0; font-size: .8rem; margin: .2rem 0; opacity: .85; }
.game-updated { color: #7cffa0; }

.rating-login-hint { color: #9a9ab0; font-size: .85rem; margin-bottom: .6rem; }
.rating-login-hint a { color: #7cc8ff; }

/* per-star breakdown bars */
.rating-breakdown { display: flex; flex-direction: column; gap: .3rem; }
.breakdown-row {
    display: grid; grid-template-columns: 2.5rem 1fr 2.2rem;
    align-items: center; gap: .5rem;
}
.breakdown-label { color: #cfcfe0; font-size: .85rem; text-align: right; white-space: nowrap; }
.breakdown-bar-track {
    height: 10px; background: #1a1a2e; border-radius: 5px; overflow: hidden;
    border: 1px solid #2a2a40;
}
.breakdown-bar-fill {
    height: 100%; width: 0; background: linear-gradient(90deg, #e94560, #ffb86c);
    border-radius: 5px; transition: width .4s ease;
}
.breakdown-count { color: #9a9ab0; font-size: .85rem; text-align: right; }

/* ── Comments ── */
.comments-section { max-width: 720px; margin-top: 2rem; }
.comments-section h2 { margin-bottom: .8rem; }

.comment-form { margin-bottom: 1.2rem; }
.comment-input {
    width: 100%; box-sizing: border-box; resize: vertical;
    padding: .55rem .7rem; border-radius: 6px;
    border: 1px solid #2a2a40; background: #12121f; color: #e8e8f0;
    font: inherit;
}
.comment-input:focus { outline: none; border-color: #7cc8ff; }
.comment-form-row {
    display: flex; align-items: center; justify-content: flex-end;
    gap: .8rem; margin-top: .5rem;
}
.comment-counter { color: #9a9ab0; font-size: .8rem; margin-right: auto; }
.comment-error { color: #ff9aa8; font-size: .85rem; margin: .4rem 0 0; }
.comment-login-hint { color: #9a9ab0; }
.comment-login-hint a { color: #7cc8ff; }

.comments-empty { color: #9a9ab0; }

.comment {
    padding: .7rem .9rem; border-radius: 8px;
    background: #16162a; border: 1px solid #23233a;
    margin-bottom: .7rem;
}
.comment-hidden { opacity: .75; border-style: dashed; }
.comment-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .35rem; }
.comment-author { font-weight: bold; color: #ffb86c; }
.comment-date { color: #8a8aa0; font-size: .8rem; }
.comment-body { white-space: pre-wrap; word-break: break-word; }
.comment-tombstone { color: #8a8aa0; font-style: italic; }

.comment-mod { margin-top: .5rem; }
.comment-mod-btn { background: #2a2a40; }
.comment-mod-btn:hover { background: #37374f; }

.comment-footer { display: flex; gap: 1rem; align-items: center; margin-top: .5rem; }
.comment-toggle, .comment-reply-btn {
    background: none; border: none; cursor: pointer; font: inherit; padding: 0;
    color: #7cc8ff;
}
.comment-toggle:hover, .comment-reply-btn:hover { text-decoration: underline; }

.comment-replies {
    margin: .7rem 0 0 1rem; padding-left: .9rem;
    border-left: 2px solid #2a2a40;
}
.comment-reply { background: #13131f; }
.comment-reply-form { margin-top: .6rem; }

/* ── Community forum ── */
.breadcrumb { color: #8a8aa0; font-size: .9rem; margin: .5rem 0 1rem; }
.breadcrumb a { color: #7cc8ff; text-decoration: none; }
.breadcrumb span { margin: 0 .25rem; }

.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.forum-head h1 { margin: 0; }
.forum-head-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.forum-search { display: flex; gap: .4rem; }
.forum-search input[type=search] {
    padding: .4rem .6rem; border-radius: 6px; border: 1px solid #2a2a40;
    background: #12121f; color: #e8e8f0; font: inherit;
}
.forum-search-page { margin: 1rem 0; }
.forum-topic-count { color: #9a9ab0; }

.badge-sticky { background: #352a5e; color: #c9b6ff; }

.forum-category { margin-top: 1.6rem; }
.forum-category-title {
    text-transform: uppercase; letter-spacing: .06em; font-size: .95rem;
    color: #ffb86c; border-bottom: 2px solid #e94560; padding-bottom: .3rem; margin-bottom: .6rem;
}

.forum-boards, .forum-topics { list-style: none; padding: 0; margin: 0; }

.forum-board-row, .forum-topic-row {
    display: flex; align-items: center; gap: 1rem;
    padding: .8rem .9rem; border: 1px solid #23233a; border-radius: 8px;
    background: #16162a; margin-bottom: .6rem;
}
.forum-board-main, .forum-topic-main { flex: 1; min-width: 0; }
.forum-board-name, .forum-topic-title {
    color: #7cc8ff; font-weight: bold; font-size: 1.05rem; text-decoration: none;
}
.forum-board-name:hover, .forum-topic-title:hover { text-decoration: underline; }
.forum-board-desc { color: #9a9ab0; margin: .25rem 0 0; }
.forum-topic-excerpt { color: #b8b8c8; margin: .2rem 0; }

.forum-board-count { text-align: center; min-width: 5rem; }
.forum-board-count .n { display: block; font-size: 1.2rem; font-weight: bold; color: #7cffa0; }
.forum-board-count .label { color: #8a8aa0; font-size: .8rem; }

.forum-board-last, .forum-topic-last { min-width: 11rem; text-align: right; }
.forum-last-title { color: #7cc8ff; text-decoration: none; display: block; }
.forum-last-author { color: #ffb86c; display: block; }

.forum-topic-badges { display: inline-flex; gap: .35rem; margin-bottom: .2rem; }
.forum-topic-stats { min-width: 7rem; text-align: right; color: #9a9ab0; font-size: .85rem; }
.forum-topic-stats span { display: block; }
.forum-topic-stats strong, .forum-topic-last strong { color: #e8e8f0; }
.forum-topic-row.is-hidden { opacity: .7; border-style: dashed; }

.forum-empty { color: #9a9ab0; }
.forum-rules { margin: .5rem 0 1rem; }
.forum-rules summary { cursor: pointer; color: #7cc8ff; }
.forum-rules-body { white-space: pre-wrap; color: #cfcfe0; margin-top: .4rem; }

/* Topic page */
.forum-topic-head h1 { margin-bottom: .2rem; }
.forum-mod-bar {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    padding: .6rem .8rem; background: #1a1430; border: 1px solid #352a5e; border-radius: 8px; margin-bottom: 1rem;
}
.forum-mod-label { color: #c9b6ff; font-weight: bold; }
.forum-mod-bar form.inline, .forum-mod-bar form { display: inline; margin: 0; }
.forum-move-form { display: inline-flex; gap: .3rem; }
.forum-move-form select {
    padding: .3rem .5rem; border-radius: 6px; border: 1px solid #2a2a40; background: #12121f; color: #e8e8f0;
}
.forum-postbar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .5rem 0; border-bottom: 1px solid #23233a; margin-bottom: 1rem;
}

.forum-posts { display: flex; flex-direction: column; gap: .8rem; }
.forum-post {
    padding: .9rem 1rem; border: 1px solid #23233a; border-radius: 8px; background: #16162a;
}
.forum-post.is-op { border-left: 3px solid #e94560; }
.forum-post.is-hidden { opacity: .75; border-style: dashed; }
.forum-post-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.forum-post-author { font-weight: bold; color: #ffb86c; }
.forum-post-body { word-break: break-word; }
.forum-post-body p { margin: .4rem 0; }
.forum-post-body ul, .forum-post-body ol { margin: .4rem 0; padding-left: 1.5rem; }
.forum-post-body a { color: #7cc8ff; }
.forum-post-body code {
    background: #0f0f1a; border: 1px solid #2a2a40; border-radius: 4px; padding: .05rem .3rem; font-size: .9em;
}
.forum-post-body pre {
    background: #0f0f1a; border: 1px solid #2a2a40; border-radius: 6px; padding: .6rem .8rem; overflow-x: auto;
}
.forum-post-body pre code { border: 0; padding: 0; }
.forum-post-body blockquote {
    margin: .5rem 0; padding: .2rem .8rem; border-left: 3px solid #352a5e; color: #c9b6ff;
}
.forum-post-body img { max-width: 100%; height: auto; border-radius: 6px; }
.forum-tombstone { color: #8a8aa0; font-style: italic; }
.forum-post-mod { display: flex; gap: .4rem; margin-top: .6rem; }
.forum-post-mod form { display: inline; margin: 0; }

.forum-reply { margin-top: 1.5rem; max-width: 760px; }
.forum-new-topic { max-width: 760px; }

.admin-cat { margin-top: 1.4rem; }
.admin-cat form.inline { display: inline; margin: 0; }

/* Likes, quotes & post actions */
.forum-post-actions { display: flex; align-items: center; gap: .9rem; margin-top: .7rem; }
.forum-like-btn {
    background: #1a1a2e; border: 1px solid #2a2a40; color: #e8e8f0; cursor: pointer;
    font: inherit; padding: .2rem .6rem; border-radius: 999px;
}
.forum-like-btn:hover { border-color: #e94560; }
.forum-like-btn.liked { background: #3a1420; border-color: #e94560; color: #ff9aa8; }
.forum-like-btn:disabled { opacity: .6; cursor: default; }
.forum-like-static { color: #9a9ab0; }
.like-count { font-weight: bold; }
.forum-post-action { color: #7cc8ff; text-decoration: none; font-size: .9rem; }
.forum-post-action:hover { text-decoration: underline; }

.forum-quote {
    margin: 0 0 .6rem; padding: .4rem .7rem; border-left: 3px solid #352a5e;
    background: #14142a; border-radius: 0 6px 6px 0;
}
.forum-quote-author { display: block; color: #c9b6ff; font-size: .85rem; margin-bottom: .15rem; }
.forum-quote-author a { color: #c9b6ff; }
.forum-quote-text { color: #9a9ab0; font-style: italic; }

.forum-quoting-note {
    padding: .5rem .7rem; background: #14142a; border: 1px solid #352a5e; border-radius: 6px;
    color: #c9b6ff;
}
.forum-quoting-note a { color: #7cc8ff; margin-left: .4rem; }

a.forum-last-author { text-decoration: none; }
a.forum-last-author:hover { text-decoration: underline; }

/* Report a post (reader-facing, on the topic page) */
.forum-report { margin-top: .6rem; }
.forum-report summary {
    cursor: pointer; color: #9a9ab0; font-size: .85rem; display: inline-block;
}
.forum-report summary:hover { color: #e94560; }
.forum-report-form { margin-top: .5rem; max-width: 520px; }
.forum-report-form textarea { width: 100%; }
.forum-report-form .btn { margin-top: .4rem; }

/* Forum profile page */
.forum-profile {
    padding: 1rem 1.1rem; border: 1px solid #23233a; border-radius: 10px;
    background: #16162a; margin-bottom: 1.4rem;
}
.forum-profile h1 { margin: 0 0 .15rem; }

/* Admin moderation queue (reported posts) */
.report-card {
    padding: .9rem 1rem; border: 1px solid #23233a; border-radius: 10px;
    background: #16162a; margin-bottom: 1rem; border-left: 3px solid #e94560;
}
.report-card.is-hidden { opacity: .8; border-left-color: #8a8aa0; }
.report-card-head { margin-bottom: .5rem; }
.report-card-head a { color: #7cc8ff; }
.report-excerpt {
    margin: .4rem 0 .6rem; padding: .4rem .8rem; border-left: 3px solid #352a5e;
    background: #14142a; border-radius: 0 6px 6px 0; color: #c9b6ff; white-space: pre-wrap; word-break: break-word;
}
.report-reasons { list-style: none; padding: 0; margin: 0 0 .7rem; display: flex; flex-direction: column; gap: .35rem; }
.report-reasons li { font-size: .9rem; }
.report-reason { color: #e8e8f0; }
.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.report-actions form.inline { display: inline; margin: 0; }

@media (max-width: 768px) {
    .forum-board-row, .forum-topic-row { flex-direction: column; align-items: stretch; }
    .forum-board-last, .forum-topic-last, .forum-topic-stats, .forum-board-count { text-align: left; min-width: 0; }
}

/* --- auth pages (login / register / confirm / reset) --- */
.auth-card {
    max-width: 440px; margin: 1.5rem auto;
    background: #16162a; border: 1px solid #23233a; border-radius: 10px; padding: 1.5rem 1.6rem;
}
.auth-card h1 { margin: 0 0 .3rem; font-size: 1.6rem; }
.auth-sub { color: #9a9ab0; margin: 0 0 1.2rem; }
.auth-card p { line-height: 1.6; }

.auth-form { display: flex; flex-direction: column; gap: .3rem; }
.auth-form label { color: #9a9ab0; font-size: .85rem; margin-top: .6rem; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    background: #1a1a2e; color: #e8e8f0; border: 1px solid #2a2a40;
    border-radius: 6px; padding: .55rem .7rem; font: inherit; width: 100%; box-sizing: border-box;
}
.auth-form input:focus-visible { outline: 2px solid #7cc8ff; outline-offset: 1px; }
.auth-form .checkbox { display: flex; align-items: center; gap: .5rem; color: #e8e8f0; margin-top: .8rem; }
.auth-form .checkbox input { margin: 0; }
.auth-form button[type="submit"] { margin-top: 1.1rem; width: 100%; }

.auth-links { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.auth-links a { color: #7cc8ff; }

.auth-divider { display: flex; align-items: center; gap: .6rem; color: #8a8aa0; margin: 1.2rem 0; font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #23233a; }

.auth-external form { margin: 0; }
.btn-google {
    background: #fff; color: #222; width: 100%; justify-content: center;
    display: inline-flex; align-items: center; gap: .5rem;
}
.btn-google:hover { background: #e9e9ef; }
/* Prominent, placed-on-top Google sign-up button. */
.auth-external-top { margin-bottom: .2rem; }
.btn-google-lg { padding: .7rem 1rem; font-size: 1.05rem; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.35); }

/* validation + status (classes emitted by the asp-validation tag helpers) */
.validation-summary-valid { display: none; }
.validation-summary-errors {
    color: #ff6b81; border-left: 3px solid #ff6b81; background: #2a1420;
    padding: .5rem .8rem; margin-bottom: 1rem; border-radius: 0 6px 6px 0;
}
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.field-validation-error { color: #ff9aa8; font-size: .8rem; display: block; margin-top: .15rem; }
.auth-status { color: #7cffa0; border-left: 3px solid #7cffa0; padding: .5rem .8rem; margin-bottom: 1rem; }
.auth-status.is-error { color: #ff6b81; border-left-color: #ff6b81; }

/* --- account management (/Identity/Account/Manage) --- */
.manage-layout { display: flex; gap: 1.5rem; align-items: flex-start; margin-top: 1rem; }
.manage-nav { list-style: none; padding: 0; margin: 0; min-width: 200px; display: flex; flex-direction: column; gap: .25rem; }
.manage-nav a {
    display: block; padding: .5rem .75rem; border-radius: 6px; color: #7cc8ff;
    text-decoration: none; border: 1px solid transparent;
}
.manage-nav a:hover { background: #1a1a2e; }
.manage-nav a.active { background: #1a1430; border-color: #352a5e; color: #c9b6ff; font-weight: bold; }
.manage-content { flex: 1; min-width: 0; max-width: 640px; }
.manage-content h1 { margin-top: 0; }
.manage-section { margin-bottom: 1.6rem; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; margin: 1rem 0; }
.recovery-codes code {
    background: #0f0f1a; border: 1px solid #2a2a40; border-radius: 4px;
    padding: .35rem .5rem; text-align: center; letter-spacing: .05em;
}
@media (max-width: 768px) {
    .manage-layout { flex-direction: column; }
    .manage-nav { flex-direction: row; flex-wrap: wrap; min-width: 0; }
}

/* ===== Avatars ===== */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; object-fit: cover; background: #23233a;
    color: #c9b6ff; font-weight: bold; text-transform: uppercase;
    overflow: hidden; flex: none; border: 1px solid #2a2a40;
}
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-md { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.9rem; }
.avatar-initials { user-select: none; }

/* Avatar editor on the account Profile page */
.avatar-editor { margin-bottom: 1.8rem; }
.avatar-editor h2 { margin: 0 0 .6rem; }
.avatar-editor-row { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.avatar-editor-controls { flex: 1; min-width: 220px; }
.avatar-editor-controls form { margin-bottom: .6rem; }

/* Nav: current user with avatar + unread badge */
.nav-user { display: inline-flex; align-items: center; gap: .45rem; }
.nav-badge { margin-left: .3rem; }
.badge-new { background: #4a1f27; color: #ff9aa8; }

/* Forum profile header (avatar beside name) */
.forum-profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.forum-profile-id { min-width: 0; }
.forum-profile-id h1 { margin: 0 0 .15rem; }

/* ===== Private messages ===== */
.pm-head { display: flex; align-items: center; margin-bottom: 1rem; }
.pm-head-link { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.pm-head-link h1 { margin: 0; font-size: 1.4rem; }

.pm-thread {
    display: flex; flex-direction: column; gap: .6rem;
    padding: 1rem; border: 1px solid #23233a; border-radius: 10px;
    background: #16162a; margin-bottom: 1rem; max-height: 60vh; overflow-y: auto;
}
.pm-msg { max-width: 75%; padding: .5rem .75rem; border-radius: 12px; }
.pm-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.pm-msg-time { font-size: .72rem; margin-top: .2rem; }
.pm-msg-theirs { align-self: flex-start; background: #1a1a2e; border: 1px solid #23233a; border-bottom-left-radius: 3px; }
.pm-msg-mine { align-self: flex-end; background: #1a1430; border: 1px solid #352a5e; border-bottom-right-radius: 3px; }
.pm-msg-mine .pm-msg-time { text-align: right; }

.pm-compose textarea { width: 100%; box-sizing: border-box; }

/* Inbox list */
.pm-inbox { list-style: none; padding: 0; margin: 0; }
.pm-inbox-row { border: 1px solid #23233a; border-radius: 10px; background: #16162a; margin-bottom: .6rem; }
.pm-inbox-row.pm-unread { border-left: 3px solid #e94560; }
.pm-inbox-link { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; color: inherit; text-decoration: none; }
.pm-inbox-link:hover { background: #1a1a2e; }
.pm-inbox-main { flex: 1; min-width: 0; }
.pm-inbox-top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.pm-inbox-name { font-weight: bold; color: #ffb86c; }
.pm-unread .pm-inbox-name { color: #ffd479; }
.pm-inbox-preview {
    margin: .15rem 0 0; color: #9a9ab0; font-size: .9rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-unread .pm-inbox-preview { color: #c7c7da; }
.pm-inbox-dot { flex: none; }

@media (max-width: 768px) {
    .pm-msg { max-width: 88%; }
}

/* ── In-browser emulator ("Play" button + player modal) ── */
.emu-play {
    background: #7cffa0; color: #0f0f1a; border-color: #7cffa0;
    display: inline-flex; align-items: center; gap: .4rem;
}
.emu-play:hover { background: #5be084; border-color: #5be084; color: #0f0f1a; }
.library-play { margin: .2rem 0 .4rem; }
.card-play { margin: .4rem 0 0; }

/* "Load and play your own games" block on My Games. */
.byod-play {
    margin: 2rem 0 0; padding: 1.1rem 1.2rem;
    background: #16162a; border: 1px solid #23233a; border-radius: 10px;
}
.byod-play h2 { margin: 0 0 .3rem; color: #ffb86c; }
.byod-play .meta { margin: 0 0 .8rem; }

/* Full-screen overlay holding the player. */
.emu-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; box-sizing: border-box;
    background: rgba(5, 5, 12, .85);
}
.emu-modal[hidden] { display: none; }
body.emu-open { overflow: hidden; }

.emu-dialog {
    display: flex; flex-direction: column;
    width: min(960px, 100%); max-height: 100%;
    background: #16162a; border: 1px solid #23233a; border-radius: 10px;
    overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.emu-dialog:fullscreen { width: 100%; height: 100%; max-height: none; border-radius: 0; }

.emu-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .55rem .8rem; background: #1a1a2e; border-bottom: 1px solid #23233a;
}
.emu-title { font-weight: bold; color: #ffb86c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emu-bar-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.emu-about { font-size: .8rem; color: #7cc8ff; }
.emu-cta { background: #7cffa0; color: #0f0f1a; font-weight: bold; white-space: nowrap; }
.emu-cta:hover { background: #5be084; }
.emu-cta[hidden] { display: none; }
.emu-btn {
    background: #23233a; color: #e7e7f2; border: 1px solid #352a5e;
    border-radius: 6px; padding: .35rem .7rem; font-size: .85rem; cursor: pointer;
}
.emu-btn:hover { border-color: #e94560; }
.emu-btn.emu-close:hover { background: #3a1420; color: #ff9aa8; }

/* 4:3 player area (the CPC display), capped so it never exceeds the viewport. */
.emu-frame-wrap { background: #000; }
.emu-frame {
    display: block; width: 100%; aspect-ratio: 4 / 3;
    max-height: calc(100vh - 8rem); border: 0;
}
/* Fullscreen: the wrapper must grow to fill the dialog below the bar, and the iframe
   fill the wrapper — otherwise the iframe collapses to a thin strip at the top. */
.emu-dialog:fullscreen .emu-frame-wrap { flex: 1 1 auto; min-height: 0; }
.emu-dialog:fullscreen .emu-frame {
    width: 100%; height: 100%; max-height: none; aspect-ratio: auto;
}

@media (max-width: 768px) {
    .emu-modal { padding: 0; }
    .emu-dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .emu-about { display: none; }
    /* A demo's call-to-action doesn't fit beside the buttons on a phone: give it its own
       full-width row under them (only when it's shown, so the plain player bar is unchanged). */
    .emu-bar:has(.emu-cta:not([hidden])) { flex-wrap: wrap; }
    .emu-bar:has(.emu-cta:not([hidden])) .emu-bar-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
    .emu-cta { order: 1; flex: 1 1 100%; text-align: center; }
}

/* ── Markdown compose toolbar ── */
.md-toolbar {
    display: flex; flex-wrap: wrap; gap: .25rem;
    margin-bottom: .4rem;
    padding: .3rem; border-radius: 6px 6px 0 0;
    background: #12121f; border: 1px solid #2a2a40; border-bottom: none;
}
/* Pull the textarea flush against the toolbar it sits under. */
.md-toolbar + .comment-input { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-btn {
    min-width: 2rem; height: 2rem; padding: 0 .5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px; cursor: pointer;
    border: 1px solid #2a2a40; background: #1a1a2e; color: #e8e8f0;
    font-size: .9rem; line-height: 1;
}
.md-btn:hover { background: #23233a; border-color: #7cc8ff; }
.md-btn:disabled { opacity: .5; cursor: progress; }
.md-btn-bold { font-weight: 700; }
.md-btn-italic { font-style: italic; }
.md-btn-help { margin-left: auto; font-weight: 700; color: #7cc8ff; }
.comment-input.md-dragover { border-color: #7cc8ff; box-shadow: 0 0 0 2px rgba(124, 200, 255, .3); }

/* "Markdown supported" link that opens the help popup */
.md-help-link {
    background: none; border: none; padding: 0; cursor: pointer;
    color: #7cc8ff; font: inherit; font-size: .8rem; text-decoration: underline dotted;
}
.md-help-link:hover { color: #a9dbff; }

/* Help popup */
.md-help-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(5, 5, 12, .72);
}
.md-help-modal[hidden] { display: none; }
.md-help-dialog {
    width: 100%; max-width: 460px; max-height: 85vh; overflow: auto;
    background: #16162a; border: 1px solid #23233a; border-radius: 10px;
    padding: 1.1rem 1.3rem; box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}
.md-help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.md-help-head h3 { margin: 0; font-size: 1.05rem; }
.md-help-close {
    background: none; border: none; cursor: pointer;
    color: #9a9ab0; font-size: 1.4rem; line-height: 1; padding: 0 .2rem;
}
.md-help-close:hover { color: #e94560; }
.md-help-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.md-help-table th { text-align: left; color: #9a9ab0; font-weight: 600; padding: .3rem .4rem; border-bottom: 1px solid #23233a; }
.md-help-table td { padding: .3rem .4rem; border-bottom: 1px solid #1d1d30; vertical-align: top; }
.md-help-table code {
    background: #12121f; border: 1px solid #2a2a40; border-radius: 4px;
    padding: .05rem .3rem; font-size: .82rem; color: #ffb86c;
}
.md-help-tip { margin: .8rem 0 0; color: #9a9ab0; font-size: .82rem; }
