.memorama-sub {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    color: #3c4043;
}

body.ps-hub.memorama-hub.dark-mode .memorama-sub {
    color: #9aa0a6;
}

body.ps-hub.memorama-hub.dark-mode .memorama-end {
    background: #292a2d;
}

body.ps-hub.memorama-hub.dark-mode .memorama-mode {
    background: #292a2d;
    border-color: #3c4043;
    color: #e8eaed;
}

body.ps-hub.memorama-hub.dark-mode .memorama-btn {
    background: #292a2d;
    border-color: #3c4043;
    color: #e8eaed;
}

.memorama-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.memorama-mode {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 999px;
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.memorama-mode.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

a.memorama-mode--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.memorama-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: #3c4043;
}

.memorama-mio-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

body.ps-hub.memorama-hub.memorama-mode-daily .memorama-turn-row,
body.ps-hub.memorama-hub.memorama-mode-daily #memoramaTurnRow {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

#memoramaTurnRow[hidden] {
    display: none !important;
}

.memorama-mio-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.memorama-mio-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f766e;
}

.memorama-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
}

body.memorama-hub .memorama-card {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    min-height: 72px;
    min-width: 0;
    border: 0;
    border-radius: 10px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: transparent;
    position: relative;
    overflow: hidden;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

body.memorama-hub .memorama-card:disabled {
    cursor: default;
    opacity: 0.85;
}

body.memorama-hub .memorama-card__inner {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 72px;
    position: relative;
}

body.memorama-hub .memorama-card__face {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.35rem 0.25rem;
    box-sizing: border-box;
}

body.memorama-hub:not(.memorama-hub--civica):not(.memorama-hub--regional) .memorama-card__back {
    background: linear-gradient(145deg, #0f766e, #134e4a);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

body.memorama-hub .memorama-card__front {
    display: none;
    background: #fff;
    border: 2px solid #99f6e4;
    color: #202124;
}

body.memorama-hub .memorama-card.is-flipped .memorama-card__back,
body.memorama-hub .memorama-card.is-matched .memorama-card__back {
    display: none;
}

body.memorama-hub .memorama-card.is-flipped .memorama-card__front,
body.memorama-hub .memorama-card.is-matched .memorama-card__front {
    display: flex;
}

body.memorama-hub.dark-mode .memorama-card__front {
    background: #292a2d;
    border-color: #0f766e;
    color: #e8eaed;
}

.memorama-card__word {
    font-size: clamp(0.62rem, 2.8vw, 0.82rem);
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
    hyphens: auto;
}

.memorama-card__country {
    margin-top: 0.15rem;
    font-size: clamp(0.55rem, 2.4vw, 0.68rem);
    font-weight: 600;
    color: #64748b;
}

.memorama-card.is-matched .memorama-card__front {
    border-color: #22c55e;
    background: #ecfdf5;
}

.memorama-end {
    margin-top: 1rem;
    padding: 0.85rem;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
}

.memorama-end h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.memorama-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.65rem 0 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: #25d366;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none !important;
}

.memorama-btn {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.5rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* Cómo se juega — same collapsible pattern as billar.php */
body.ps-hub.memorama-hub .memorama-how.billar-how {
    margin: 0 0 0.75rem;
    max-width: 100%;
    width: 100%;
}

body.ps-hub.memorama-hub .billar-how--collapsible {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

body.ps-hub.memorama-hub.dark-mode .billar-how--collapsible {
    background: #202124;
    border-color: #3c4043;
}

body.ps-hub.memorama-hub .billar-how--collapsible > .billar-how__box {
    border: 0 !important;
    border-radius: 0;
    border-top: 1px solid #e5e7eb !important;
    background: #f8f9fa;
}

body.ps-hub.memorama-hub.dark-mode .billar-how--collapsible > .billar-how__box {
    border-top-color: #3c4043;
    background: #292a2d;
}

body.ps-hub.memorama-hub .billar-how--collapsible > .billar-how__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    margin: 0;
}

body.ps-hub.memorama-hub .billar-how--collapsible > .billar-how__title::-webkit-details-marker {
    display: none;
}

body.ps-hub.memorama-hub .billar-how--collapsible > .billar-how__title::after {
    content: '';
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #3c4043;
    border-bottom: 2px solid #3c4043;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-top: -0.15rem;
}

body.ps-hub.memorama-hub .billar-how--collapsible[open] > .billar-how__title::after {
    transform: rotate(-135deg);
    margin-top: 0.15rem;
}

body.ps-hub.memorama-hub .billar-how--collapsible > .billar-how__title:hover {
    background: color-mix(in srgb, #0f766e 6%, #fff);
}

body.ps-hub.memorama-hub.dark-mode .billar-how--collapsible > .billar-how__title:hover {
    background: color-mix(in srgb, #0f766e 12%, #202124);
}

body.ps-hub.memorama-hub .billar-how__num {
    background: color-mix(in srgb, #0f766e 14%, #fff) !important;
    color: #0f766e !important;
}

.memorama-yesterday {
    margin-top: 1.25rem;
    font-size: 0.82rem;
}

.memorama-yesterday h2 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.memorama-yesterday__list {
    margin: 0;
    padding-left: 1.1rem;
}

.memorama-yesterday__list li {
    margin-bottom: 0.35rem;
}

/* —— Multijugador teaser (mismo patrón que billar.php) —— */
body.ps-hub.memorama-hub .billar-room-teaser--mobile {
    display: none;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 992px) {
    body.ps-hub.memorama-hub .billar-room-teaser--mobile.memorama-room-teaser {
        display: block;
    }
    body.ps-hub.memorama-hub .hub-rail__card--memorama-multi {
        display: none;
    }
}

body.ps-hub.memorama-hub .billar-room-teaser--highlight {
    background: #dcfce7;
    border-color: #86efac;
    box-shadow: 0 4px 18px rgba(10, 110, 48, 0.1);
}

body.ps-hub.memorama-hub .billar-room-teaser--highlight .billar-room-teaser__link {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

body.ps-hub.memorama-hub .billar-room-teaser--highlight .billar-room-teaser__label {
    color: #166534;
}

body.ps-hub.memorama-hub.dark-mode .billar-room-teaser--highlight {
    background: #14532d;
    border-color: #22c55e;
}

body.ps-hub.memorama-hub.dark-mode .billar-room-teaser--highlight .billar-room-teaser__link {
    background: #166534;
    border-color: #22c55e;
}

body.ps-hub.memorama-hub .hub-rail__card--memorama-multi {
    background: #dcfce7;
    border: 1px solid #86efac;
    box-shadow: 0 4px 14px rgba(10, 110, 48, 0.1);
}

body.ps-hub.memorama-hub .hub-rail__card--memorama-multi .hub-rail__link {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

body.ps-hub.memorama-hub .hub-rail__card--memorama-multi .hub-rail__label {
    color: #166534;
}

body.ps-hub.memorama-hub.dark-mode .hub-rail__card--memorama-multi {
    background: #14532d;
    border-color: #22c55e;
}

body.ps-hub.memorama-hub.dark-mode .hub-rail__card--memorama-multi .hub-rail__link {
    background: #166534;
    border-color: #22c55e;
}

body.ps-hub.memorama-hub .billar-room-teaser__label {
    margin: 0 0 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hub-accent, #0f766e);
}

body.ps-hub.memorama-hub .billar-room-teaser__link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none !important;
    color: inherit !important;
    background: #f8f9fa;
    border: 1px solid var(--fz-line, #e5e7eb);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
}

body.ps-hub.memorama-hub .billar-room-teaser__title {
    font-size: 0.88rem;
    font-weight: 800;
}

body.ps-hub.memorama-hub .billar-room-teaser__desc {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--fz-muted, #3c4043);
    line-height: 1.35;
}

body.ps-hub.memorama-hub .billar-room-teaser__badge {
    display: inline-block;
    margin-top: 0.25rem;
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, #dc2626 14%, #fff);
    color: #b91c1c;
}

body.ps-hub.memorama-hub .billar-room-teaser {
    background: #fff;
    border: 1px solid var(--fz-line, #e5e7eb);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
}

body.ps-hub.memorama-hub .memorama-toolbar .memorama-mode:only-child {
    flex: 0 1 auto;
    min-width: 8.5rem;
}

/* —— Memorama de Ciudadanía —— */
body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-grid {
    --mc-cols: 4;
    --mc-rows: 3;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

@media (max-width: 420px) {
    body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-grid {
        gap: 0.25rem;
    }
}

body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-card .memorama-card__back {
    background-color: #1e293b;
    background-repeat: no-repeat;
    color: transparent;
    font-size: 0;
    line-height: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-card .memorama-card__back .memorama-civica-card__back-kind,
body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-card .memorama-card__back .memorama-civica-card__back-emoji {
    display: none;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-regional-grid,
body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 420px) {
    body.ps-hub.memorama-hub.memorama-hub--regional .memorama-regional-grid,
    body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-grid {
        gap: 0.25rem;
    }
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-panel .memorama-card {
    min-height: 0;
    min-width: 0;
    border-radius: 8px;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-panel .memorama-card__face {
    border-radius: 8px;
    padding: 0.28rem 0.2rem;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-panel .memorama-card__word {
    font-size: clamp(0.62rem, 2.4vw, 0.78rem);
    line-height: 1.15;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-panel .memorama-card__country {
    font-size: clamp(0.52rem, 2vw, 0.65rem);
    margin-top: 0.12rem;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-toolbar-row .memorama-toolbar {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-civica-panel .memorama-toolbar .memorama-mode:only-child {
    flex: 0 1 auto;
    min-width: 9rem;
    max-width: 100%;
}

.memorama-mode--dual-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.memorama-mode__label--mio .mio-name-with-tip {
    padding-right: 0.55em;
}

.memorama-mode__label--mio .mio-info-tip--nested {
    pointer-events: auto;
}

.memorama-mode-hint {
    margin: -0.15rem 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    color: #64748b;
}

body.ps-hub.memorama-hub.dark-mode .memorama-mode-hint {
    color: #9aa0a6;
}

body.ps-hub.memorama-hub.memorama-hub--regional .memorama-card .memorama-card__back {
    background-color: #1e293b;
    background-repeat: no-repeat;
    color: transparent;
    font-size: 0;
    line-height: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.memorama-yesterday--in-how {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid color-mix(in srgb, var(--fz-line, #e7e5e4) 70%, transparent);
}

.memorama-yesterday--in-how h2 {
    font-size: 0.84rem;
    font-weight: 800;
    margin: 0 0 0.45rem;
    color: var(--fz-ink, #202124);
}

.memorama-yesterday--in-how .memorama-yesterday__list {
    font-size: 0.8rem;
    line-height: 1.42;
}

.memorama-civica-progress {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3c4043;
}

.memorama-civica-progress__bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-top: 0.35rem;
    overflow: hidden;
}

.memorama-civica-progress__fill {
    display: block;
    height: 100%;
    width: 0;
    background: #1d3f8f;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.memorama-civica-reset {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.memorama-civica-lang {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
    margin-left: auto;
}

.memorama-civica-lang button {
    border: 0;
    background: #f8fafc;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.memorama-civica-lang button.is-active {
    background: #1d3f8f;
    color: #fff;
}

.memorama-civica-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.memorama-civica-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.memorama-civica-filter {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.memorama-civica-filter.is-active {
    background: #1d3f8f;
    border-color: #1d3f8f;
    color: #fff;
}

body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-card--q .memorama-card__front {
    background: #e8f1fc;
    border-color: #93c5fd;
    color: #0f172a;
}

body.ps-hub.memorama-hub.memorama-hub--civica .memorama-civica-card--a .memorama-card__front {
    background: #e8f5f0;
    border-color: #86efac;
    color: #0f172a;
}

body.ps-hub.memorama-hub.memorama-hub--civica .memorama-card.is-matched .memorama-card__front {
    background: #d1fae5;
    border-color: #22c55e;
    color: #14532d;
}

body.ps-hub.memorama-hub.memorama-hub--civica.dark-mode .memorama-civica-card--q .memorama-card__front {
    background: #1e3a5f;
    border-color: #60a5fa;
    color: #e8eaed;
}

body.ps-hub.memorama-hub.memorama-hub--civica.dark-mode .memorama-civica-card--a .memorama-card__front {
    background: #134e4a;
    border-color: #6ee7b7;
    color: #e8eaed;
}

body.ps-hub.memorama-hub.memorama-hub--civica.dark-mode .memorama-card.is-matched .memorama-card__front {
    background: #14532d;
    border-color: #4ade80;
    color: #ecfdf5;
}

.memorama-civica-card__badge {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.85;
}

.memorama-civica-card__cat {
    font-size: 0.85rem;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.memorama-civica-card__text {
    font-size: clamp(0.55rem, 2.6vw, 0.72rem);
    font-weight: 700;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
    padding: 0 0.15rem;
}

.memorama-civica-card--num .memorama-civica-card__text {
    font-size: 1rem;
}

.memorama-civica-match-shell {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, 0.48);
    box-sizing: border-box;
}

.memorama-civica-match-shell[hidden] {
    display: none !important;
}

.memorama-civica-match {
    position: relative;
    width: min(100%, 400px);
    max-height: min(78vh, 520px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #111827;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    padding: 1rem 1.1rem 1.15rem;
    box-sizing: border-box;
}

.memorama-civica-match__title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1d3f8f;
}

.memorama-civica-match__q {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.memorama-civica-match__en {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.memorama-civica-match ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
}

.memorama-civica-match ul li {
    margin-bottom: 0.2rem;
    line-height: 1.45;
}

.memorama-civica-match__lang,
.memorama-civica-match h3 {
    margin: 0.65rem 0 0.25rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 800;
}

.memorama-civica-match__next {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.55rem;
    border: 0;
    border-radius: 999px;
    background: #1d3f8f;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.memorama-civica-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.memorama-civica-overlay[hidden] {
    display: none !important;
}

body.memorama-hub .memorama-civica-card .memorama-card__back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    gap: 0.15rem;
}

.memorama-civica-card__back-kind {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.92;
}

.memorama-civica-overlay__box {
    background: #fff;
    border-radius: 14px;
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    padding: 1rem 1.1rem;
}

.memorama-civica-overlay__q {
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.memorama-civica-overlay__qen {
    margin: 0 0 0.65rem;
    color: #64748b;
    font-size: 0.88rem;
}

.memorama-civica-end-list {
    text-align: left;
    margin: 0.65rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
}

body.ps-hub.memorama-hub.dark-mode .memorama-civica-match,
body.ps-hub.memorama-hub.dark-mode .memorama-civica-overlay__box {
    background: #292a2d;
    color: #e8eaed;
}
