/**
 * Architects Memory Game — Scoped Styles
 * Namespace: .architects-memory (all rules prefixed with .am-)
 * Copyright (c) 01-08-2026 rolando simoncelli. All rights reserved.
 */

.architects-memory {
    --am-navy: #0D2146;
    --am-navy-soft: #152d5a;
    --am-gold: #FBC02D;
    --am-gold-soft: #FFC107;
    --am-bg: #F4F4F4;
    --am-white: #FFFFFF;
    --am-text: #333333;
    --am-text-muted: #666666;
    --am-border: #DDDDDD;
    --am-shadow: 0 8px 24px rgba(13, 33, 70, 0.12);
    --am-radius: 8px;
    --am-font: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --am-touch-min: 44px;

    background: var(--am-white);
    color: var(--am-text);
    font-family: var(--am-font);
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    border-radius: var(--am-radius);
    border: 1px solid var(--am-border);
    box-shadow: var(--am-shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.architects-memory * { box-sizing: border-box; }
.architects-memory button { font-family: inherit; }

.architects-memory .am-header {
    border-bottom: 3px solid var(--am-gold);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.architects-memory .am-brand { display: flex; align-items: center; gap: 14px; }
.architects-memory .am-brand-logo {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--am-navy);
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(13, 33, 70, 0.2);
}
.architects-memory .am-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
    pointer-events: none;
    user-select: none;
}
.architects-memory .am-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--am-navy);
    letter-spacing: 0.2px;
    line-height: 1.1;
}
.architects-memory .am-subtitle {
    font-size: 11px;
    color: var(--am-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.architects-memory .am-tagline {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--am-text-muted);
    line-height: 1.5;
}

.architects-memory .am-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}
.architects-memory .am-difficulty {
    display: inline-flex;
    background: var(--am-navy);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
}
.architects-memory .am-diff-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    padding: 7px 16px;
    min-height: var(--am-touch-min);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: color 0.2s, background 0.2s;
    touch-action: manipulation;
}
.architects-memory .am-diff-btn:hover { color: #fff; }
.architects-memory .am-diff-btn.is-active {
    background: var(--am-gold);
    color: var(--am-navy);
}
.architects-memory .am-diff-short { display: none; }

.architects-memory .am-controls-actions {
    margin-left: auto;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.architects-memory .am-restart,
.architects-memory .am-sound-toggle,
.architects-memory .am-invite {
    border: 1.5px solid var(--am-navy);
    background: transparent;
    color: var(--am-navy);
    padding: 8px 14px;
    min-height: var(--am-touch-min);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.architects-memory .am-restart:hover,
.architects-memory .am-sound-toggle:hover,
.architects-memory .am-invite:hover {
    background: var(--am-navy);
    color: var(--am-white);
    transform: translateY(-1px);
}
.architects-memory .am-sound-toggle[aria-pressed="false"] { opacity: 0.45; }

.architects-memory .am-scoreboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.architects-memory .am-stat {
    background: var(--am-bg);
    border: 1px solid var(--am-border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.architects-memory .am-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 33, 71, 0.08);
}
.architects-memory .am-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--am-text-muted);
    margin-bottom: 4px;
    font-weight: 700;
}
.architects-memory .am-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--am-navy);
}

.architects-memory .am-board {
    display: grid;
    gap: 10px;
    perspective: 1400px;
}
.architects-memory .am-board[data-rows="4"] { min-height: clamp(240px, 48vw, 380px); }
.architects-memory .am-board[data-rows="6"] { min-height: clamp(320px, 62vw, 520px); }
.architects-memory .am-board[data-rows="7"],
.architects-memory .am-board[data-rows="8"] { min-height: clamp(300px, 68vw, 500px); }
.architects-memory .am-board[data-rows="9"] { min-height: clamp(340px, 72vw, 540px); }
.architects-memory .am-board[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.architects-memory .am-board[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

.architects-memory .am-card-skeleton {
    pointer-events: none;
    cursor: default;
}
.architects-memory .am-board[data-skeleton="1"] {
    contain: layout style;
}

.architects-memory .am-card {
    aspect-ratio: 3 / 4;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.architects-memory .am-card:focus-visible {
    outline: 3px solid var(--am-gold);
    outline-offset: 3px;
    border-radius: 12px;
}
.architects-memory .am-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.architects-memory .am-card.is-flipped .am-card-inner,
.architects-memory .am-card.is-matched .am-card-inner {
    transform: rotateY(180deg);
}
.architects-memory .am-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(13, 33, 70, 0.15);
}
.architects-memory .am-card-face-back {
    background-color: var(--am-navy);
    background-image:
        var(--am-card-back-logo-img, none),
        var(--am-card-back-wordmark-img, none),
        linear-gradient(135deg, var(--am-navy) 0%, var(--am-navy-soft) 100%);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center 38%, center 78%, center;
    background-size: 48% auto, 78% auto, cover;
    border: 2px solid var(--am-gold);
    flex-direction: column;
    padding: 10px 8px;
}
.architects-memory .am-card-back-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
}
.architects-memory .am-card-face-back svg,
.architects-memory .am-card-face-back .am-card-back-logo {
    width: 54%;
    height: auto;
    max-height: 58%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
    pointer-events: none;
    user-select: none;
}
.architects-memory .am-card-back-wordmark {
    width: 92%;
    max-width: 210px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.architects-memory .am-card-face-front {
    background: linear-gradient(165deg, #faf6ee 0%, #f3ece0 100%);
    border: 2px solid var(--am-navy);
    transform: rotateY(180deg);
}
.architects-memory .am-card-face-front svg { width: 60%; height: 60%; }
.architects-memory .am-card-face-front .am-landmark-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 8px;
    filter: contrast(1.08) saturate(0.88);
}
.architects-memory .am-card-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 6px 7px;
    background: linear-gradient(180deg, transparent 0%, rgba(13, 33, 70, 0.94) 55%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}
.architects-memory .am-card-name {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.02em;
}
.architects-memory .am-card-architect {
    font-size: 8px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--am-gold);
    letter-spacing: 0.03em;
}
.architects-memory .am-card.is-matched .am-card-label {
    opacity: 1;
    transform: translateY(0);
}

.architects-memory .am-match-toast {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(94%, 420px);
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(13, 33, 70, 0.94);
    border: 1px solid var(--am-gold);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(13, 33, 70, 0.28);
    opacity: 0;
    transform: translate(-50%, -12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}
.architects-memory .am-match-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.architects-memory .am-match-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--am-gold);
    color: var(--am-navy);
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}
.architects-memory .am-match-toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
    min-width: 0;
}
.architects-memory .am-match-toast-name {
    font-size: 13px;
    font-weight: 700;
}
.architects-memory .am-match-toast-architect {
    font-size: 11px;
    font-weight: 600;
    color: var(--am-gold);
}
.architects-memory .am-match-toast-meta {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.architects-memory .am-match-toast-fact {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
}

.architects-memory .am-card.is-matched .am-card-face-front {
    border-color: var(--am-gold);
    box-shadow: 0 0 0 2px var(--am-gold) inset, 0 6px 18px rgba(242, 184, 7, 0.35);
}
.architects-memory .am-card.is-matched { cursor: default; }

@media (hover: hover) and (pointer: fine) {
    .architects-memory .am-card:hover:not(.is-flipped):not(.is-matched) .am-card-inner {
        transform: translateY(-5px) rotateZ(-1deg);
    }
}
.architects-memory.is-touch .am-card:active:not(.is-flipped):not(.is-matched) .am-card-inner {
    transform: scale(0.97);
}
.architects-memory .am-card.is-shake .am-card-inner {
    animation: am-shake 0.45s ease;
}
@keyframes am-shake {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    20%      { transform: rotateY(180deg) translateX(-7px); }
    50%      { transform: rotateY(180deg) translateX(7px); }
    80%      { transform: rotateY(180deg) translateX(-4px); }
}

.architects-memory .am-modal {
    position: fixed;
    inset: 0;
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none !important;
}
.architects-memory .am-modal.is-open {
    display: flex !important;
    pointer-events: auto !important;
}
.architects-memory .am-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 33, 70, 0.82);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.architects-memory .am-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.architects-memory .am-modal-card {
    position: relative;
    background: var(--am-white);
    border-radius: 18px;
    padding: 38px 32px 30px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    z-index: 2;
    box-shadow: 0 30px 70px rgba(13, 33, 70, 0.4);
    animation: am-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 6px solid var(--am-gold);
}
@keyframes am-pop {
    from { transform: scale(0.6) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.architects-memory .am-modal-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    min-height: 50px;
}
.architects-memory .am-star {
    width: 48px;
    height: 48px;
    opacity: 0;
    transform: scale(0) rotate(-90deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
    filter: drop-shadow(0 4px 8px rgba(251, 192, 45, 0.45));
}
.architects-memory .am-star.is-on {
    opacity: 1;
    transform: scale(1) rotate(0);
}
.architects-memory .am-modal-title {
    margin: 0 0 10px;
    font-size: 26px;
    color: var(--am-navy);
    font-weight: 800;
    letter-spacing: 0.3px;
}
.architects-memory .am-modal-stats {
    color: var(--am-text-muted);
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.7;
}
.architects-memory .am-modal-stats strong { color: var(--am-navy); }
.architects-memory .am-share-feedback {
    display: none;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251, 192, 45, 0.18) 0%, rgba(13, 33, 70, 0.06) 100%);
    border: 1.5px solid var(--am-gold);
    text-align: center;
}
.architects-memory .am-share-feedback[hidden] {
    display: none !important;
}
.architects-memory .am-share-feedback.is-show {
    display: block;
    animation: am-share-in 0.35s ease;
}
@keyframes am-share-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.architects-memory .am-share-feedback-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: var(--am-navy);
}
.architects-memory .am-share-feedback-hint {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--am-text-muted);
}
.architects-memory .am-share-channels {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.architects-memory .am-share-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.architects-memory .am-share-wa {
    background: #25D366;
    color: #fff;
}
.architects-memory .am-share-tg {
    background: #229ED9;
    color: #fff;
}
.architects-memory .am-share-channel:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 33, 70, 0.18);
    color: #fff;
}
.architects-memory .am-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.architects-memory .am-modal-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 4px;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--am-navy);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.3px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.architects-memory .am-modal-portal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 33, 70, 0.28);
    color: #fff;
    background: #16356f;
}
.architects-memory .am-modal-invite {
    background: transparent;
    color: var(--am-navy);
    border: 1.5px solid var(--am-navy);
    padding: 11px 28px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.architects-memory .am-modal-invite:hover {
    background: var(--am-navy);
    color: var(--am-white);
    transform: translateY(-1px);
}
.architects-memory .am-modal-cta {
    background: var(--am-gold);
    color: var(--am-navy);
    border: none;
    padding: 12px 32px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.architects-memory .am-modal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(251, 192, 45, 0.45);
    background: var(--am-gold-soft);
}

body.am-modal-open {
    overflow: hidden;
    touch-action: none;
}

.am-share-toast {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    z-index: 10050;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(92vw, 400px);
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(13, 33, 70, 0.97);
    border: 1.5px solid var(--am-gold, #FBC02D);
    color: #fff;
    box-shadow: 0 14px 36px rgba(13, 33, 70, 0.35);
    opacity: 0;
    transform: translate(-50%, -14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.am-share-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.am-share-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FBC02D;
    color: #0D2146;
    font-size: 13px;
    font-weight: 900;
    flex-shrink: 0;
}
.am-share-toast-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.am-share-toast-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}
.am-share-toast-hint {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 768px) {
    .architects-memory .am-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .architects-memory .am-difficulty {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .architects-memory .am-difficulty::-webkit-scrollbar { display: none; }
    .architects-memory .am-diff-btn {
        flex: 1 1 0;
        min-height: var(--am-touch-min);
        padding: 10px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    .architects-memory .am-controls-actions {
        margin-left: 0;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .architects-memory .am-restart,
    .architects-memory .am-sound-toggle,
    .architects-memory .am-invite {
        width: 100%;
        padding: 10px 8px;
        font-size: 11px;
    }
    .architects-memory .am-btn-label { display: none; }
    .architects-memory .am-scoreboard {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .architects-memory .am-stat {
        padding: 8px 4px;
    }
    .architects-memory .am-stat-label {
        font-size: 9px;
        letter-spacing: 1px;
    }
    .architects-memory .am-stat-value {
        font-size: 16px;
    }
    .architects-memory .am-board {
        gap: 8px;
    }
    .architects-memory .am-board[data-rows="6"] .am-card {
        aspect-ratio: 4 / 4.8;
    }
    .architects-memory .am-board[data-rows="7"] .am-card,
    .architects-memory .am-board[data-rows="8"] .am-card {
        aspect-ratio: 4 / 4.5;
    }
    .architects-memory .am-board[data-rows="9"] .am-card {
        aspect-ratio: 4 / 4.2;
    }
    .architects-memory .am-card-face {
        border-radius: 8px;
    }
    .architects-memory .am-card-inner {
        transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .architects-memory .am-modal-card {
        padding: 28px 20px 22px;
        padding-bottom: max(22px, env(safe-area-inset-bottom));
        width: min(92%, 400px);
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .architects-memory .am-modal-title {
        font-size: 22px;
    }
    .architects-memory .am-modal-invite,
    .architects-memory .am-modal-cta,
    .architects-memory .am-modal-portal {
        min-height: var(--am-touch-min);
        width: 100%;
    }
}

@media (max-width: 640px) {
    .architects-memory { padding: 14px; }
    .architects-memory .am-title { font-size: 18px; }
    .architects-memory .am-tagline { font-size: 12px; }
    .architects-memory .am-diff-long { display: none; }
    .architects-memory .am-diff-short { display: inline; }
    .architects-memory .am-diff-btn {
        font-size: 13px;
        letter-spacing: 0.2px;
    }
    .architects-memory .am-card-face-front svg,
    .architects-memory .am-card-face-back svg,
    .architects-memory .am-card-face-back .am-card-back-logo { width: 50%; max-height: 55%; }
    .architects-memory .am-card-back-wordmark { width: 94%; }
    .architects-memory .am-card-name { font-size: 8px; }
    .architects-memory .am-card-architect { font-size: 7px; }
    .architects-memory .am-card-label { padding: 18px 4px 5px; }
    .architects-memory .am-match-toast {
        font-size: 11px;
        padding: 8px 12px;
        top: 6px;
        border-radius: 12px;
    }
    .architects-memory .am-match-toast-name { font-size: 11px; }
    .architects-memory .am-match-toast-architect { font-size: 10px; }
    .architects-memory .am-match-toast-fact { font-size: 10px; }
    .architects-memory .am-card-face-front .am-landmark-img { width: 100%; height: 100%; }
}

@media (max-width: 380px) {
    .architects-memory .am-scoreboard {
        grid-template-columns: repeat(2, 1fr);
    }
    .architects-memory .am-card-name { font-size: 7px; }
    .architects-memory .am-card-architect { font-size: 6.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .architects-memory .am-card-inner { transition: transform 0.2s linear; }
    .architects-memory .am-modal-card { animation: none; }
    .architects-memory .am-star { transition: opacity 0.2s; }
}

/* Registrazione ospite (stile Planify / header auth) */
.architects-memory .am-reg-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.architects-memory .am-reg-modal.is-open { display: flex; }
.architects-memory .am-reg-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 33, 70, 0.72);
}
.architects-memory .am-reg-card {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    background: var(--am-white);
    border-radius: 12px;
    padding: 22px 20px 18px;
    box-shadow: 0 18px 48px rgba(13, 33, 70, 0.28);
    border: 1px solid var(--am-border);
}
.architects-memory .am-reg-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: var(--am-navy);
}
.architects-memory .am-reg-intro {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: var(--am-text-muted);
    line-height: 1.45;
}
.architects-memory .am-reg-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--am-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.architects-memory .am-reg-row:hover { border-color: var(--am-gold); }
.architects-memory .am-reg-row-label {
    display: block;
    font-weight: 700;
    color: var(--am-navy);
    font-size: 0.92rem;
}
.architects-memory .am-reg-row-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--am-text-muted);
    margin-top: 2px;
}
.architects-memory .am-reg-gicon {
    display: inline-flex;
    flex-shrink: 0;
}
.architects-memory .am-reg-chosen {
    margin: 0 0 10px;
    font-size: 0.9rem;
}
.architects-memory .am-reg-consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.architects-memory .am-reg-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.architects-memory .am-reg-back,
.architects-memory .am-reg-skip {
    border: none;
    background: transparent;
    color: var(--am-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}
.architects-memory .am-reg-continue {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 999px;
    background: var(--am-navy);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
}
.architects-memory .am-reg-continue--off {
    opacity: 0.45;
    pointer-events: none;
}
.architects-memory .am-reg-invite-hint {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: var(--am-text-muted);
    text-align: center;
}
.architects-memory .am-reg-footer {
    margin-top: 12px;
    text-align: center;
}