/**
 * Noos Pairs — game styles (assets/css/games/pairs.css). Card faces live in assets/css/cards.css.
 */
:root {
    --card-w: clamp(75px, 13vh, 120px);
    --card-h: calc(var(--card-w) * 1.4);
    --header-h: 70px;
}
body, html { overflow-x: hidden; margin: 0; padding: 0; background: #f1f5f9; font-family: 'Quicksand', sans-serif; }

.game-meta { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 1000px; margin: 5px auto; padding: 0 15px; gap: 10px; box-sizing: border-box; }
.tier-setup { display: flex; justify-content: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.tier-actions { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.diff-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
    text-decoration: none; color: #64748b; font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.02); font-family: inherit;
}
.diff-btn:hover { border-color: #b45309; color: #b45309; transform: translateY(-1px); }
.diff-btn.active { background: #b45309; color: #fff; border-color: #b45309; }
.stats-group { display: flex; gap: 15px; background: white; padding: 8px 15px; border-radius: 15px; border: 1px solid #e2e8f0; flex-wrap: wrap; }
.move-counter, .deck-count { font-weight: 800; color: #334155; font-size: 0.9rem; }
.tier-setup.locked { pointer-events: none; cursor: not-allowed; }
.tier-setup.locked .diff-btn { opacity: 0.5; filter: grayscale(0.5); background: #f1f5f9; border-color: #cbd5e1; color: #94a3b8; }
.tier-setup.locked .diff-btn.active { background: #94a3b8; color: #fff; }

.game-container { display: flex; gap: 25px; padding: 10px 20px; justify-content: center; align-items: center; min-height: calc(90dvh - var(--header-h) - 40px); }
.game-board { display: grid; gap: 10px; }
.side-panel { display: flex; flex-direction: column; gap: 25px; align-items: center; justify-content: center; min-width: calc(var(--card-w) + 10px); }
.pile-container, .deck-visual-container { display: flex; flex-direction: column; align-items: center; width: 100%; }
.panel-label { color: #64748b; margin: 0 0 8px 0; font-size: 0.75rem; text-align: center; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

.card-slot { width: var(--card-w); height: var(--card-h); position: relative; }
.card-slot .noos-card, .collection-pile .noos-card { width: 100%; height: 100%; cursor: pointer; }
.collection-pile .noos-card { cursor: default; }
.card-slot .noos-card .card-inner { transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); }
.collection-pile, .source-deck-stack { width: var(--card-w); height: var(--card-h); border: 2px dashed #cbd5e1; border-radius: 10px; position: relative; box-sizing: border-box; }
.collection-pile .pile-card, .source-deck-stack .pile-card { position: absolute; width: calc(var(--card-w) - 4px); height: calc(var(--card-h) - 4px); top: -2px; left: -2px; }
.collection-pile .pile-card .noos-card { width: 100%; height: 100%; }

.flying-card { position: fixed; z-index: 10000; pointer-events: none; transition: top .7s cubic-bezier(.19,1,.22,1), left .7s cubic-bezier(.19,1,.22,1); }
.flying-card .noos-card { width: 100%; height: 100%; }

@keyframes hintElevate {
    0%   { transform: translateY(0) scale(1); }
    50%  { transform: translateY(-12px) scale(1.08); filter: drop-shadow(0 14px 18px rgba(180,83,9,.55)); }
    100% { transform: translateY(0) scale(1); }
}
.noos-card.hint-highlight { z-index: 500; animation: hintElevate 1s ease-in-out infinite; }

body.diff-24, body.diff-52 { --card-w: clamp(75px, 12dvh, 125px); }
@media (min-width: 1200px) { :root { --card-w: clamp(90px, 14.5vh, 135px); } }
@media (max-height: 850px) and (orientation: landscape) {
    :root { --card-w: clamp(85px, 8.5vh, 110px); }
    body.diff-8, body.diff-12 { --card-w: clamp(100px, 12vh, 140px); }
    .game-container { padding: 0 15px; gap: 10px; }
    .game-board { gap: 6px; }
}
@media (max-width: 1100px) { body.diff-52 { --card-w: clamp(60px, 8vh, 85px); } }
@media (max-width: 768px) {
    :root { --card-w: clamp(52px, 16vw, 75px); --header-h: 55px; }
    body.diff-24, body.diff-52 { --card-w: clamp(52px, 16vw, 75px); }
    .game-container { flex-direction: column; padding: 5px; gap: 15px; min-height: 0; }
    .game-board { gap: 4px; }
    .side-panel { flex-direction: row; justify-content: space-around; align-items: flex-end; width: 100%; gap: 10px; margin-top: 5px; }
    .tier-actions { flex-direction: column; gap: 10px; align-items: stretch; }
    .panel-label { font-size: 0.6rem; margin-bottom: 2px; }
}
@media (min-width: 769px) and (max-width: 1024px) { .game-container { padding: 10px; gap: 15px; } .game-board { gap: 8px; } }
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    :root { --card-w: clamp(90px, 15vw, 150px); }
    body.diff-52 { --card-w: clamp(75px, 13vw, 115px); }
    .game-board { gap: 12px; }
}

/* Hint "watch an ad" modal */
.ad-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.9); backdrop-filter: blur(8px); z-index: 20000; display: flex; align-items: center; justify-content: center; }
.ad-content { background: white; padding: 40px; border-radius: 24px; max-width: 400px; width: 85%; text-align: center; position: relative; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); animation: modalIn 0.4s cubic-bezier(0.34,1.56,0.64,1); box-sizing: border-box; }
.ad-timer { position: absolute; top: -15px; right: -10px; background: var(--accent, #f59e0b); color: white; width: 45px; height: 45px; border-radius: 50%; text-align: center; line-height: 38px; display: block; font-weight: bold; border: 3px solid white; box-sizing: border-box; }
#claimHintBtn { display: block; background: #10b981; color: white; border: none; padding: 16px 20px; border-radius: 14px; cursor: pointer; font-weight: 700; width: 100%; margin-top: 24px; font-family: 'Quicksand', sans-serif; font-size: 16px; box-shadow: 0 4px 6px -1px rgba(16,185,129,0.3); box-sizing: border-box; transition: transform 0.2s; }
#claimHintBtn:active { transform: scale(0.98); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) { .ad-content { padding: 40px 20px 30px; width: 88%; } .ad-timer { right: -5px; } }
@media (prefers-reduced-motion: reduce) { .flying-card { transition: none; } .noos-card.hint-highlight { animation: none; } }
