/* Giochi per conoscersi: stili propri (fuori dal build Tailwind, nessuna
   classe nuova da compilare). Prefisso ymg-. */

.ymg-pixel { font-family: "Press Start 2P", ui-monospace, monospace; letter-spacing: 0.5px; }
.ymg-wrap { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.ymg-wrap--narrow { max-width: 44rem; }
.ymg-eyebrow { font-size: 10px; color: #fbbf24; text-transform: uppercase; }
.ymg-h1 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.75rem, 4.5vw, 2.4rem); color: #f8f4fb; margin: 0.4rem 0 0.5rem; line-height: 1.15; text-wrap: balance; }
.ymg-lead { color: #a8a0b4; font-size: 0.95rem; line-height: 1.6; max-width: 60ch; margin: 0; }
.ymg-h2 { font-size: 1rem; font-weight: 600; color: #f1eef5; margin: 0 0 0.75rem; }
.ymg-section { margin-top: 2rem; }
.ymg-muted { color: #8e8699; font-size: 0.85rem; line-height: 1.55; }
.ymg-flash { margin-top: 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.875rem; color: #fde68a; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25); }

/* Catalogo */
.ymg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; }
.ymg-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.1rem; border-radius: 16px; background: linear-gradient(160deg, #1d1022 0%, #150b19 100%); border: 1px solid rgba(225,29,72,0.18); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; min-width: 0; }
.ymg-card:hover { border-color: rgba(225,29,72,0.5); transform: translateY(-2px); }
.ymg-card:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ymg-card__top { display: flex; align-items: center; gap: 0.7rem; }
.ymg-badge { flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(225,29,72,0.14); color: #fb7185; }
.ymg-card__name { font-weight: 600; color: #fff; font-size: 1rem; }
.ymg-card__meta { font-size: 0.75rem; color: #8e8699; }
.ymg-card__text { font-size: 0.85rem; color: #b6aec0; line-height: 1.5; margin: 0; }

/* Illustrazioni in pixel art (App\Support\GameArt) */
.ymg-art { display: block; width: 100%; height: 100%; }
.ymg-card--art { padding: 0; overflow: hidden; gap: 0; }
.ymg-card__art { display: block; aspect-ratio: 2 / 1; overflow: hidden; border-bottom: 1px solid rgba(225,29,72,0.18); }
.ymg-card__art .ymg-art { transition: transform .25s ease; }
.ymg-card--art:hover .ymg-card__art .ymg-art { transform: scale(1.04); }
.ymg-card__body { display: block; padding: 0.9rem 1.1rem 1.1rem; }
.ymg-hero-art { margin-top: 1.25rem; aspect-ratio: 2 / 1; max-height: 16rem; width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid rgba(225,29,72,0.25); }

/* Liste partite e persone */
.ymg-list { display: flex; flex-direction: column; gap: 0.5rem; }
.ymg-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); color: inherit; text-decoration: none; min-width: 0; }
a.ymg-row:hover { border-color: rgba(225,29,72,0.4); }
.ymg-row--hot { border-color: rgba(225,29,72,0.45); background: rgba(225,29,72,0.07); }
.ymg-row__main { flex: 1; min-width: 0; }
.ymg-row__title { color: #f1eef5; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ymg-row__sub { color: #8e8699; font-size: 0.78rem; }
.ymg-avatar { width: 2.4rem; height: 2.4rem; border-radius: 999px; object-fit: cover; flex-shrink: 0; background: #2a1426; display: flex; align-items: center; justify-content: center; color: #fb7185; font-weight: 700; }
.ymg-pill { flex-shrink: 0; font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 999px; background: rgba(225,29,72,0.16); color: #fda4af; }
.ymg-pill--wait { background: rgba(255,255,255,0.06); color: #a8a0b4; }

/* Pulsanti */
.ymg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.875rem; font-weight: 600; padding: 0.6rem 1.1rem; border-radius: 12px; border: 0; cursor: pointer; text-decoration: none; background: linear-gradient(135deg, #e11d48, #9d174d); color: #fff; }
.ymg-btn:hover { filter: brightness(1.1); }
.ymg-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.ymg-btn--ghost { background: rgba(255,255,255,0.05); color: #e9e4ef; border: 1px solid rgba(255,255,255,0.1); }
.ymg-btn--sm { font-size: 0.8rem; padding: 0.45rem 0.8rem; border-radius: 10px; }
.ymg-btn:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ymg-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Riquadro per chi non è registrato */
.ymg-cta { margin-top: 1.5rem; padding: 1.25rem; border-radius: 16px; background: linear-gradient(135deg, #2d0a1e, #1a0a1e); border: 1px solid rgba(225,29,72,0.3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.ymg-cta p { margin: 0; color: #e9e4ef; font-size: 0.95rem; max-width: 40ch; }

/* Regole */
.ymg-rules { margin: 0; padding-left: 1.1rem; color: #b6aec0; font-size: 0.9rem; line-height: 1.7; }

/* Classifica */
.ymg-board { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ymg-board td { padding: 0.5rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.05); color: #e9e4ef; }
.ymg-board td.ymg-rank { width: 2.5rem; color: #fbbf24; font-variant-numeric: tabular-nums; }
.ymg-board td.ymg-score { text-align: right; font-variant-numeric: tabular-nums; color: #fb7185; font-weight: 600; }
.ymg-board tr.ymg-me td { background: rgba(225,29,72,0.08); }

/* Partita: intestazione */
.ymg-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.25rem; }
.ymg-status { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); color: #e9e4ef; font-size: 0.9rem; }
.ymg-status--turn { border-color: rgba(225,29,72,0.45); background: rgba(225,29,72,0.08); }
.ymg-status--win { border-color: rgba(251,191,36,0.45); background: rgba(251,191,36,0.08); color: #fde68a; }

/* Quattro in fila */
.ymg-c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; border-radius: 14px; background: #2b1a6b; box-shadow: inset 0 -4px 0 #1d1150; max-width: 26rem; margin: 0 auto; }
.ymg-c4__col { display: grid; grid-template-rows: repeat(6, 1fr); gap: 4px; padding: 0; border: 0; background: transparent; border-radius: 10px; cursor: pointer; }
.ymg-c4__col:disabled { cursor: default; }
.ymg-c4__col:not(:disabled):hover { background: rgba(255,255,255,0.08); }
.ymg-c4__col:focus-visible { outline: 2px solid #fbbf24; }
.ymg-c4__cell { aspect-ratio: 1; border-radius: 999px; background: #120b24; box-shadow: inset 0 3px 0 rgba(0,0,0,0.45); }
.ymg-c4__cell--1 { background: #ff4f8b; box-shadow: inset 0 -3px 0 #b8245c, inset 0 2px 0 rgba(255,255,255,0.35); }
.ymg-c4__cell--2 { background: #ffd36e; box-shadow: inset 0 -3px 0 #c7962a, inset 0 2px 0 rgba(255,255,255,0.4); }
.ymg-c4__cell--last { outline: 2px solid rgba(255,255,255,0.7); outline-offset: -2px; }
.ymg-c4__cell--line { animation: ymg-pulse 0.9s ease-in-out infinite alternate; }
@keyframes ymg-pulse { from { filter: brightness(1); } to { filter: brightness(1.45); } }
.ymg-legend { display: flex; justify-content: center; gap: 1.2rem; margin-top: 0.8rem; font-size: 0.8rem; color: #b6aec0; }
.ymg-dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 999px; vertical-align: -2px; margin-right: 0.35rem; }

/* Quiz */
.ymg-quiz { display: flex; flex-direction: column; gap: 0.9rem; }
.ymg-q { padding: 1rem; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.ymg-q__n { font-size: 9px; color: #fbbf24; }
.ymg-q__text { margin: 0.45rem 0 0.7rem; color: #fff; font-weight: 600; font-size: 0.95rem; }
.ymg-q__opts { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ymg-opt { font-size: 0.85rem; padding: 0.5rem 0.8rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); color: #e9e4ef; cursor: pointer; }
.ymg-opt:hover { border-color: rgba(225,29,72,0.5); }
.ymg-opt[aria-pressed="true"] { background: #e11d48; border-color: #e11d48; color: #fff; }
.ymg-opt:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ymg-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; font-size: 0.82rem; }
.ymg-cmp__cell { padding: 0.45rem 0.6rem; border-radius: 10px; background: rgba(255,255,255,0.04); color: #d8d1e0; min-width: 0; }
.ymg-cmp__label { display: block; font-size: 0.7rem; color: #8e8699; margin-bottom: 0.15rem; }
.ymg-q--same { border-color: rgba(52,211,153,0.4); }
.ymg-same { font-size: 0.72rem; color: #6ee7b7; font-weight: 600; }
.ymg-score { text-align: center; padding: 1.25rem; border-radius: 16px; background: linear-gradient(135deg, #2d0a1e, #1a0a1e); border: 1px solid rgba(225,29,72,0.35); }
.ymg-score__num { font-size: 2.2rem; color: #ffd36e; margin: 0.4rem 0; }

/* Questo o quello: due grandi pulsanti affiancati */
.ymg-q__opts--duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ymg-q__opts--duo .ymg-opt { border-radius: 12px; padding: 0.75rem 0.6rem; font-weight: 600; text-align: center; }

/* Battaglia navale */
.ymg-bs { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.ymg-bs__title { margin: 0.4rem 0 0; font-size: 0.8rem; color: #b6aec0; }
.ymg-bs__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 6px; border-radius: 12px; background: #0b2a55; width: 100%; max-width: 22rem; }
.ymg-bs__grid--own { max-width: 13rem; opacity: 0.95; }
.ymg-bs__cell { aspect-ratio: 1; border: 0; padding: 0; border-radius: 4px; background: #16407a; position: relative; }
button.ymg-bs__cell:not(:disabled) { cursor: crosshair; }
button.ymg-bs__cell:not(:disabled):hover { background: #2a5ea8; outline: 2px solid #ff4f8b; outline-offset: -2px; }
.ymg-bs__cell:focus-visible { outline: 2px solid #fbbf24; outline-offset: -2px; }
.ymg-bs__cell.is-ship { background: #8a8fa3; }
.ymg-bs__cell.is-miss::after { content: ""; position: absolute; inset: 38%; border-radius: 999px; background: #e9f6ff; }
.ymg-bs__cell.is-hit { background: #ff7a1a; box-shadow: inset 0 0 0 3px #ffd36e; }
.ymg-bs__cell.is-sunk { background: #7a1f2a; box-shadow: inset 0 0 0 2px #e8336d; }

/* Briscola: carte in pixel art */
.ymg-br { display: flex; flex-direction: column; gap: 0.6rem; }
.ymg-br__row { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; min-height: 2.5rem; }
.ymg-br__felt { display: flex; align-items: center; justify-content: center; gap: 1.5rem; padding: 1rem; border-radius: 16px; background: #145a3a; box-shadow: inset 0 0 0 3px #0e4029; flex-wrap: wrap; min-height: 9rem; }
.ymg-br__deck, .ymg-br__played { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 0.75rem; }
.ymg-br__deck .ymg-muted, .ymg-br__played .ymg-muted { color: #cfe9da; font-size: 0.75rem; }
.ymg-br__table { display: flex; gap: 0.8rem; align-items: center; }
.ymg-pc { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 4.2rem; aspect-ratio: 5 / 7; border-radius: 8px; background: #fbf6ea; border: 2px solid #e2d6bd; box-shadow: 0 3px 0 rgba(0,0,0,0.35); color: #2a1426; padding: 0; }
button.ymg-pc { cursor: pointer; transition: transform .12s; }
button.ymg-pc:not(:disabled):hover { transform: translateY(-6px); border-color: #ff4f8b; }
button.ymg-pc:disabled { cursor: default; opacity: 0.75; }
button.ymg-pc:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.ymg-pc__suit { width: 52%; display: block; }
.ymg-pc__suit svg { display: block; width: 100%; height: auto; }
.ymg-pc__rank { position: absolute; top: 5px; left: 6px; font-size: 10px; color: #b3262f; }
.ymg-pc__rank--down { top: auto; left: auto; bottom: 5px; right: 6px; transform: rotate(180deg); }
.ymg-pc--small { width: 2.8rem; }
.ymg-pc--small .ymg-pc__rank { font-size: 8px; top: 3px; left: 4px; }
.ymg-pc--small .ymg-pc__rank--down { bottom: 3px; right: 4px; top: auto; left: auto; }
.ymg-pc--trump { transform: rotate(90deg); margin: 0.6rem 0.4rem; }
.ymg-pc--back { background: repeating-linear-gradient(45deg, #e11d48 0 4px, #9d174d 4px 8px); border-color: #fbf6ea; }
.ymg-br__hand { gap: 0.7rem; }

/* Trova le coppie */
.ymg-mem { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.ymg-mem__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; width: 100%; max-width: 22rem; }
.ymg-mem__card { aspect-ratio: 3 / 4; border-radius: 10px; border: 2px solid #fbf6ea; padding: 18%; background: repeating-linear-gradient(45deg, #e11d48 0 5px, #9d174d 5px 10px); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.ymg-mem__card:not(:disabled):hover { transform: translateY(-3px); }
.ymg-mem__card:disabled { cursor: default; }
.ymg-mem__card:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.ymg-mem__card.is-up { background: #fbf6ea; border-color: #e2d6bd; }
.ymg-mem__card svg { width: 100%; height: auto; display: block; }
.ymg-mem__card.is-mine { box-shadow: 0 0 0 3px #ff4f8b; }
.ymg-mem__card.is-theirs { box-shadow: 0 0 0 3px #7fd3ff; opacity: 0.85; }
.ymg-mem__card.is-peek { box-shadow: 0 0 0 3px #fbbf24; }

/* Parola segreta */
.ymg-word { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.ymg-word__board { display: flex; flex-direction: column; gap: 5px; }
.ymg-word__row { display: flex; gap: 5px; }
.ymg-word__tile { width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 2px solid #3a3550; color: #fff; font-family: "Press Start 2P", monospace; font-size: 0.85rem; }
.ymg-word__tile.is-small { width: 1.1rem; height: 1.1rem; font-size: 0.45rem; border-width: 1px; border-radius: 3px; }
.ymg-word__tile.is-g { background: #2fae66; border-color: #2fae66; }
.ymg-word__tile.is-y { background: #e0a82e; border-color: #e0a82e; }
.ymg-word__tile.is-x { background: #3a3550; border-color: #3a3550; }
.ymg-word__form { display: flex; gap: 0.5rem; }
.ymg-word__input { width: 9rem; text-transform: uppercase; letter-spacing: 0.3em; font-family: "Press Start 2P", monospace; font-size: 0.8rem; padding: 0.6rem 0.7rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); color: #fff; }
.ymg-word__input:focus { outline: 2px solid #fbbf24; }

/* Due verità e una bugia */
.ymg-tt__input { width: 100%; resize: vertical; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: #fff; padding: 0.6rem 0.7rem; font-size: 0.9rem; margin-top: 0.5rem; }
.ymg-tt__input:focus { outline: 2px solid #fbbf24; }
.ymg-tt__lie { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.82rem; color: #d8d1e0; cursor: pointer; }
.ymg-tt__card { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; text-align: left; padding: 0.8rem 0.9rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: #f1eef5; font-size: 0.92rem; }
.ymg-tt__card > span:first-child { flex: 1 1 14rem; min-width: 0; }
button.ymg-tt__card { cursor: pointer; }
button.ymg-tt__card:hover { border-color: rgba(225,29,72,0.55); }
button.ymg-tt__card:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ymg-tt__card.is-picked { border-color: #fbbf24; }
.ymg-tt__card.is-lie { background: rgba(232,51,109,0.12); border-color: rgba(232,51,109,0.5); }
.ymg-tt__card.is-true { background: rgba(47,174,102,0.08); }
.ymg-tt__tag { font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.08); color: #e9e4ef; }

/* Corsa all'Aperitivo */
.ymg-screen { background: #0a0614; border: 4px solid #3a2560; border-radius: 12px; padding: 6px; max-width: 48rem; margin: 0 auto; }
.ymg-screen canvas { display: block; width: 100%; aspect-ratio: 256 / 224; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: manipulation; cursor: pointer; outline: none; -webkit-user-select: none; user-select: none; }
.ymg-screen canvas:focus-visible { box-shadow: 0 0 0 3px #fbbf24; }
.ymg-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; max-width: 48rem; margin: 0.75rem auto 0; }
.ymg-seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; overflow: hidden; }
.ymg-seg button { font-size: 0.8rem; font-weight: 600; padding: 0.45rem 0.8rem; background: rgba(255,255,255,0.03); color: #e9e4ef; border: 0; cursor: pointer; }
.ymg-seg button[aria-pressed="true"] { background: #e11d48; color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .ymg-card, .ymg-c4__cell--line, .ymg-card__art .ymg-art { transition: none; animation: none; }
}
