/* ============================================
   TossIdeas Paradox Playground — games.css v2
   ============================================ */

/* Base */
.pg-dark {
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
}

/* Navbar */
.pg-nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 0;
}
.pg-nav .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}
.pg-nav .nav-links a {
    color: #1e293b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}
.pg-nav .nav-links a:hover {
    color: #dc2626;
}
.pg-nav .nav-links a.active {
    color: #dc2626;
    font-weight: 600;
}
.pg-nav .logo {
    color: #0f172a;
    text-decoration: none;
}

/* Hero */
.pg-hero {
    padding: 160px 0 80px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.pg-hero-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220,38,38,0.18), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.pg-badge {
    display: inline-block;
    background: rgba(220,38,38,0.15);
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.3);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.pg-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}
.pg-subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Hub Grid */
.pg-hub {
    padding: 0 0 100px;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}
.game-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}
.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(220,38,38,0.4);
    box-shadow: 0 20px 40px rgba(220,38,38,0.1), 0 0 0 1px rgba(220,38,38,0.1);
}
.game-card:hover::after { opacity: 1; }
.game-card-inner {
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.game-icon-wrap {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.game-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
}
.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 10px;
}
.game-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
}
.game-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 20px;
}
.btn-play-full {
    background: transparent;
    border: 1px solid rgba(220,38,38,0.4);
    color: #dc2626;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}
.game-card:hover .btn-play-full {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* ---- Modals ---- */
.game-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}
.game-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.game-modal-content {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}
.game-modal.active .game-modal-content {
    transform: translateY(0) scale(1);
}
.btn-close-game {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #94a3b8;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.2s;
}
.btn-close-game:hover { background: rgba(220,38,38,0.2); color:#dc2626; }

.modal-game-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    padding-right: 40px;
}
.modal-game-sub {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* Result common */
.result-anim {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
    animation: popIn 0.5s ease;
}
.result-label {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.result-archetype {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}
.result-desc {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}
.btn-replay {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: block;
    margin: 0 auto;
    transition: all 0.2s;
}
.btn-replay:hover { border-color: #fff; color: #fff; }

/* ---- GAME 1: SWIPE ---- */
.swipe-progress-wrap { text-align: center; margin-bottom: 20px; }
.swipe-dots { display: flex; justify-content: center; gap: 8px; }
.swipe-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: background 0.3s, transform 0.3s;
}
.swipe-dot.active { background: #dc2626; transform: scale(1.2); }
.swipe-arena {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
}
.swipe-card {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    user-select: none;
    cursor: grab;
    transition: transform 0.15s ease, opacity 0.15s;
}
.swipe-card.is-dragging { cursor: grabbing; transition: none; }
.swipe-card.fly-left {
    transform: translateX(-120%) rotate(-20deg) !important;
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s;
}
.swipe-card.fly-right {
    transform: translateX(120%) rotate(20deg) !important;
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s;
}
.swipe-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.swipe-lbl {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
}
.swipe-lbl.left { background: rgba(100,116,139,0.3); }
.swipe-lbl.right { background: rgba(220,38,38,0.25); }
.swipe-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.swipe-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}
.swipe-btn.left { background: #334155; color: #e2e8f0; }
.swipe-btn.right { background: #dc2626; color: #fff; }
.swipe-btn.left:hover { background: #475569; }
.swipe-btn.right:hover { background: #b91c1c; }

/* ---- GAME 2: SCRATCH ---- */
.scratch-myth-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.scratch-myth-label { font-size: 0.8rem; color: #64748b; display: block; margin-bottom: 8px; }
.scratch-myth-text { font-size: 1rem; font-style: italic; color: #e2e8f0; margin: 0; }
.scratch-hint { text-align: center; color: #64748b; font-size: 0.85rem; margin-bottom: 14px; }
.scratch-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
}
.scratch-reveal {
    position: absolute;
    inset: 0;
    background: #1e3a5f;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-size: 1.05rem;
    font-style: italic;
    color: #fff;
    line-height: 1.6;
}
.scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    border-radius: 16px;
}

/* ---- GAME 3: SPIN ---- */
.spin-wrap { text-align: center; }
.spin-pointer-wrap { position: relative; height: 20px; display: flex; justify-content: center; z-index: 2; }
.spin-needle {
    font-size: 1.5rem;
    color: #fff;
    line-height: 1;
    margin-bottom: -8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.spin-wheel-wrap {
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 40px rgba(220,38,38,0.2);
}
.spin-result-box {
    text-align: center;
    animation: popIn 0.5s ease;
}
.spin-result-emoji { font-size: 3rem; margin-bottom: 12px; }
.spin-coupon {
    background: rgba(220,38,38,0.1);
    border: 1px dashed rgba(220,38,38,0.4);
    border-radius: 8px;
    padding: 14px 20px;
    margin-top: 16px;
    font-size: 1rem;
    color: #e2e8f0;
}
.spin-coupon strong {
    color: #fbbf24;
    font-size: 1.3rem;
    letter-spacing: 2px;
}

/* ---- GAME 4: QUIZ ---- */
.quiz-status { margin-bottom: 24px; }
.quiz-status span { font-size: 0.8rem; color: #64748b; display: block; margin-bottom: 8px; }
.quiz-bar-wrap { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.quiz-bar { height: 100%; background: #dc2626; border-radius: 3px; transition: width 0.4s ease; }
.quiz-q-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-opt {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 14px 20px;
    border-radius: 12px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}
.quiz-opt:hover {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.3);
    color: #fff;
}

/* Quiz Result */
.quiz-result-view { animation: popIn 0.5s ease; }
.quiz-speaker-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    margin: 16px 0;
}
.quiz-speaker-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    display: flex; align-items:center; justify-content:center;
    margin: 0 auto 16px;
}
.quiz-speaker-card h3 { font-size: 1.3rem; color: #fff; margin-bottom: 8px; }
.quiz-speaker-quote { font-style: italic; color: #94a3b8; font-size: 0.9rem; margin: 0; }
.quiz-match-reason { text-align: center; color: #94a3b8; font-size: 0.9rem; line-height: 1.6; }

/* Animations */
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
    .pg-hero { padding: 120px 0 60px; }
    .game-modal-content { padding: 28px 20px; }
    .spin-wheel-wrap canvas { width: 260px !important; height: 260px !important; }
}
