/* =========================================================================
 * پک‌من: هزارتوی نئون — استایل خودبسنده (وب + اپ) v1.2
 * همهٔ کلاس‌ها با پیشوند pn- . چیدمان سه‌ستونه را کلاس مشترک qb-pacman-3col-layout
 * در games-hall.css می‌دهد (همان گرید منچ)؛ اینجا فقط ظاهر بازی و کارت‌های ستون‌هاست.
 * خود صحنهٔ بازی (.pn-shell) همیشه تیره/نئونی است؛ کارت‌های دو سایدبار با توکن‌های
 * quizb-design-tokens.css هم در تم روز و هم شب خوانا می‌مانند.
 * ========================================================================= */
[data-pn-layout],
#pacman-neon-root,
.pn-root {
    --pn-accent: #facc15;
    --pn-cyan: #22d3ee;
    --pn-ink: var(--qb-text, #0f172a);
    --pn-muted: var(--qb-text-muted, #64748b);
    --pn-line: var(--qb-border-soft, #e2e8f0);
    --pn-gold: var(--qb-warning, #b45309);
    --pn-row: rgba(100, 116, 139, 0.1);
}
html.dark [data-pn-layout],
.dark [data-pn-layout],
html.dark #pacman-neon-root,
.dark #pacman-neon-root,
html.dark .pn-root,
.dark .pn-root {
    --pn-gold: #fde047;
    --pn-row: rgba(148, 163, 184, 0.09);
}
#pacman-neon-root,
.pn-root {
    font-family: "Vazirmatn", "Sahel", system-ui, sans-serif;
    color: var(--pn-ink);
    position: relative;
    isolation: isolate;
}
#pacman-neon-root *, .pn-root * { box-sizing: border-box; }
/* ریشه فقط برای دریافت کیبورد فوکوس برنامه‌ای می‌گیرد (tabindex=-1)؛ حلقهٔ فوکوس مرورگر دور کل بازی نمی‌خواهد */
.pn-root:focus { outline: none; }
.pn-root button:not(.pn-play):not(.pn-ghost):not(.pn-mode):not(.pn-seg):not(.pn-ico) { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.pn-card button, .pn-lb-tabs button { font-family: inherit; border: 0; cursor: pointer; }
.pn-root [hidden], .pn-hidden { display: none !important; }
.pn-slot { display: grid; gap: 16px; min-width: 0; }
.pn-extra { display: grid; gap: 12px; margin-top: 12px; }

/* ===== صحنهٔ بازی (ستون وسط) — همیشه تیره ===== */
.pn-shell {
    --pn-ink: #e2e8f0;
    --pn-muted: #93a4bd;
    --pn-line: rgba(148, 163, 184, 0.18);
    --pn-gold: #fde047;
    --pn-row: rgba(148, 163, 184, 0.09);
    position: relative;
    width: 100%;
    padding: 12px;
    border-radius: 28px;
    overflow: hidden;
    color: var(--pn-ink);
    background:
        radial-gradient(110% 90% at 90% 0%, rgba(250, 204, 21, 0.10), transparent 55%),
        radial-gradient(110% 90% at 0% 100%, rgba(56, 189, 248, 0.14), transparent 55%),
        linear-gradient(160deg, #071026, #03060f 70%);
    border: 1px solid rgba(250, 204, 21, 0.28);
    box-shadow: 0 24px 70px -32px rgba(2, 8, 23, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.pn-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.8; z-index: 0; }
.pn-head, .pn-stage { position: relative; z-index: 1; }
.pn-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pn-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pn-chip {
    padding: 5px 10px; border-radius: 999px; font-size: 10px; font-weight: 800;
    background: rgba(250, 204, 21, 0.12); border: 1px solid rgba(250, 204, 21, 0.35); color: #fde68a;
}
.pn-ico {
    width: 32px; height: 32px; border-radius: 10px; font-size: 14px;
    background: rgba(148, 163, 184, 0.1); border: 1px solid var(--pn-line);
    transition: background 0.2s ease, transform 0.15s ease;
}
.pn-ico:hover { background: rgba(148, 163, 184, 0.2); }
.pn-ico:active { transform: scale(0.94); }
.pn-ico.is-on { background: rgba(250, 204, 21, 0.2); border-color: rgba(250, 204, 21, 0.5); }
.pn-root button:focus-visible, .pn-card button:focus-visible { outline: 2px solid #fde047; outline-offset: 2px; }

.pn-stage { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; }
.pn-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
.pn-stat { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 10px; background: rgba(148, 163, 184, 0.09); border: 1px solid rgba(148, 163, 184, 0.12); min-width: 0; }
.pn-stat span { font-size: 9px; color: var(--pn-muted); }
.pn-stat strong { font-size: 15px; font-weight: 900; color: #f8fafc; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-stat-score strong { font-size: 18px; color: #fde047; text-shadow: 0 0 14px rgba(250, 204, 21, 0.45); }
.pn-timer { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 10px; font-size: 11px; color: #cbd5e1; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); }
.pn-timer[hidden] { display: none; }
.pn-timer.is-danger { border-color: rgba(244, 63, 94, 0.7); color: #fda4af; animation: pn-pulse 0.8s ease-in-out infinite; }
@keyframes pn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ===== نوار جریان ===== */
.pn-flow { padding: 6px 8px; border-radius: 12px; background: rgba(148, 163, 184, 0.07); border: 1px solid rgba(148, 163, 184, 0.14); --pn-flow-c: #7dd3fc; }
.pn-flow-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--pn-muted); }
.pn-flow-top b, .pn-flow-tier { font-size: 10px; font-weight: 800; color: var(--pn-flow-c); transition: color 0.3s ease; }
.pn-bar { height: 7px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: rgba(2, 6, 18, 0.8); border: 1px solid rgba(148, 163, 184, 0.14); }
.pn-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, var(--pn-flow-c)); box-shadow: 0 0 8px var(--pn-flow-c); transition: width 0.3s ease; }
.pn-flow[data-tier="calm"] { --pn-flow-c: #7dd3fc; }
.pn-flow[data-tier="flow"] { --pn-flow-c: #22d3ee; }
.pn-flow[data-tier="surge"] { --pn-flow-c: #a78bfa; }
.pn-flow[data-tier="peak"] { --pn-flow-c: #fbbf24; border-color: rgba(251, 191, 36, 0.5); box-shadow: 0 0 14px -4px rgba(251, 191, 36, 0.6); }

/* ===== زمین بازی ===== */
.pn-frame {
    position: relative; width: 100%; max-width: min(100%, 460px, calc(68vh * 19 / 21)); margin-inline: auto; padding: 8px; border-radius: 20px;
    background: linear-gradient(180deg, rgba(8, 13, 30, 0.95), rgba(2, 5, 15, 0.98));
    border: 1.5px solid rgba(250, 204, 21, 0.4);
    box-shadow: 0 0 34px -12px rgba(250, 204, 21, 0.5), inset 0 0 22px rgba(0, 0, 0, 0.6);
}
.pn-board { display: block; width: 100%; height: auto; aspect-ratio: 19 / 21; border-radius: 12px; touch-action: none; }
.pn-hype { position: absolute; top: 14%; left: 0; right: 0; text-align: center; pointer-events: none; opacity: 0; z-index: 3; }
.pn-hype b { display: block; font-size: 20px; font-weight: 900; color: #fde047; text-shadow: 0 0 18px rgba(250, 204, 21, 0.8); }
.pn-hype span { display: block; margin-top: 2px; font-size: 11px; color: #e2e8f0; }
.pn-hype.is-show { animation: pn-hype 1.5s ease forwards; }
@keyframes pn-hype { 0% { opacity: 0; transform: translateY(8px) scale(0.92); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ===== لایه‌های روی بورد ===== */
.pn-overlay {
    position: absolute; inset: 8px; z-index: 4; display: flex; align-items: center; justify-content: center;
    padding: 10px; border-radius: 12px; background: rgba(2, 5, 15, 0.86); backdrop-filter: blur(4px);
}
.pn-panel {
    width: 100%; max-width: 330px; margin-inline: auto; max-height: 100%; overflow-y: auto; padding: 18px 16px; border-radius: 22px; text-align: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(7, 12, 28, 0.98));
    border: 1.5px solid rgba(250, 204, 21, 0.45); box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.95), 0 0 28px -8px rgba(250, 204, 21, 0.35);
    backdrop-filter: blur(8px);
}
.pn-panel-sm { max-width: 280px; }
.pn-panel h4 { margin: 6px 0 2px; font-size: 20px; font-weight: 900; color: #fef08a; text-shadow: 0 0 16px rgba(250, 204, 21, 0.5); }
.pn-emoji { font-size: 44px; line-height: 1.2; filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.6)); }
.pn-sub { margin: 0 0 12px; font-size: 11px; line-height: 1.8; color: #94a3b8; text-align: center; }
.pn-reward { display: inline-block; margin-bottom: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fde68a; background: rgba(250, 204, 21, 0.12); border: 1px solid rgba(250, 204, 21, 0.35); }

/* ===== منو، انتخاب حالت و دکمهٔ شروع نئونی پرکنتراست ===== */
/* ===== پنجرهٔ شروع مدرن و درخشان ===== */
.pn-panel-start {
    position: relative;
    max-width: 340px;
    padding: 16px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(7, 12, 28, 0.99));
    border: 1.5px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 35px -5px rgba(250, 204, 21, 0.4);
    overflow: hidden;
}
.pn-start-glow {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.35) 0%, transparent 70%);
    pointer-events: none;
}
.pn-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pn-start-logo {
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.8));
    animation: pn-pulse-glow 2s infinite ease-in-out;
}
@keyframes pn-pulse-glow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.8)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(250, 204, 21, 1)); }
}
.pn-start-titles {
    text-align: right;
}
.pn-start-titles h4 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: #fef08a;
    line-height: 1.2;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
}
.pn-start-titles p {
    margin: 2px 0 0;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
}

/* تب‌های سه‌گانه انتخاب حالت */
.pn-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
    background: rgba(2, 6, 23, 0.65);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.pn-mode {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 4px !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}
.pn-mode-ico {
    font-size: 17px;
    line-height: 1;
    margin-bottom: 3px;
}
.pn-mode b {
    display: block !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #cbd5e1 !important;
}
.pn-mode:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #f8fafc !important;
}
.pn-mode.is-active {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.22), rgba(245, 158, 11, 0.12)) !important;
    border-color: rgba(250, 204, 21, 0.6) !important;
    box-shadow: 0 0 12px -2px rgba(250, 204, 21, 0.45), inset 0 0 8px rgba(250, 204, 21, 0.15) !important;
}
.pn-mode.is-active b {
    color: #fef08a !important;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.6) !important;
}

.pn-mode-desc {
    font-size: 10.5px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.5);
    padding: 5px 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* دکمهٔ طلایی درخشان شروع بازی با کنتراست فوق‌العاده */
.pn-root .pn-play,
.pn-panel .pn-play,
.pn-play {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 13px 20px !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    background: linear-gradient(180deg, #fef08a 0%, #facc15 50%, #f59e0b 100%) !important;
    border: 1px solid #fef08a !important;
    box-shadow: 0 6px 0 #b45309, 0 12px 28px -6px rgba(250, 204, 21, 0.75) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    cursor: pointer !important;
    letter-spacing: 0.02em;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease !important;
}
.pn-root .pn-play:hover,
.pn-panel .pn-play:hover,
.pn-play:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 0 #b45309, 0 16px 32px -6px rgba(250, 204, 21, 0.85) !important;
}
.pn-root .pn-play:active,
.pn-panel .pn-play:active,
.pn-play:active {
    transform: translateY(4px) !important;
    box-shadow: 0 2px 0 #b45309, 0 6px 14px -4px rgba(250, 204, 21, 0.6) !important;
}
.pn-root .pn-play-sm,
.pn-play-sm {
    padding: 9px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 0 #b45309, 0 8px 18px -4px rgba(250, 204, 21, 0.6) !important;
}
.pn-root .pn-ghost,
.pn-ghost {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 14px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #cbd5e1 !important;
    background: rgba(148, 163, 184, 0.12) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    cursor: pointer !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}
.pn-root .pn-ghost:hover,
.pn-ghost:hover {
    background: rgba(148, 163, 184, 0.22) !important;
    color: #fff !important;
    border-color: rgba(250, 204, 21, 0.4) !important;
}
.pn-danger { color: #fda4af !important; border-color: rgba(244, 63, 94, 0.4) !important; }
.pn-duel { margin-top: 6px; background: linear-gradient(180deg, #a78bfa, #7c3aed) !important; color: #fff !important; box-shadow: 0 5px 0 #4c1d95 !important; }
.pn-row { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pn-hint { margin-top: 10px; font-size: 10px; font-weight: 700; color: #94a3b8; }

/* ===== کارت‌های ارتقا ===== */
.pn-upgrades { display: grid; gap: 8px; }
.pn-upgrade { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; align-items: center; padding: 9px 10px; text-align: right; border-radius: 14px; background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(250, 204, 21, 0.3); transition: transform 0.15s ease, border-color 0.15s ease; }
.pn-upgrade:hover { transform: translateY(-2px); border-color: rgba(250, 204, 21, 0.8); }
.pn-upgrade-ico { grid-row: span 2; font-size: 28px; text-align: center; }
.pn-upgrade b { font-size: 12px; color: #fef08a; }
.pn-upgrade em { font-style: normal; font-size: 10px; line-height: 1.7; color: #94a3b8; }

/* ===== صفحهٔ پایان ===== */
.pn-final-score { margin: 4px 0 8px; font-size: 34px; font-weight: 900; color: #fde047; text-shadow: 0 0 20px rgba(250, 204, 21, 0.5); font-variant-numeric: tabular-nums; }
.pn-final-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 8px; }
.pn-final-grid > div { padding: 5px 2px; border-radius: 9px; background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.16); }
.pn-final-grid span { display: block; font-size: 9px; color: var(--pn-muted); }
.pn-final-grid b { font-size: 13px; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.pn-peak { margin: 6px 0 4px; padding: 7px 8px; border-radius: 12px; font-size: 11px; font-weight: 800; line-height: 1.7; color: #fde68a; background: rgba(251, 191, 36, 0.09); border: 1px solid rgba(251, 191, 36, 0.28); }
.pn-delta { margin-bottom: 4px; font-size: 11px; font-weight: 700; color: #a7f3d0; }
.pn-tip { margin-bottom: 6px; font-size: 10px; line-height: 1.8; color: #94a3b8; }
.pn-peak:empty, .pn-delta:empty, .pn-tip:empty { display: none; }
.pn-sync { min-height: 28px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; line-height: 1.7; color: #cbd5e1; }
.pn-sync.is-ok { color: #6ee7b7; }
.pn-sync.is-warn { color: #fda4af; }

/* ===== راهنمای روی بوم ===== */
.pn-help { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(2, 5, 15, 0.9); border-radius: 18px; }
.pn-help-box { position: relative; width: 100%; max-width: 420px; padding: 16px; border-radius: 18px; background: #0b132b; border: 1px solid rgba(250, 204, 21, 0.3); }
.pn-help-box h4 { margin: 0 0 10px; color: #fef08a; }
.pn-help-grid { display: grid; gap: 8px; font-size: 11px; line-height: 1.8; color: #cbd5e1; }
.pn-help-grid b { display: block; color: #f1f5f9; }
.pn-close { position: absolute; top: 8px; left: 10px; font-size: 14px; color: var(--pn-muted); }

/* ===== کنترل‌ها: نوار انتخاب، جوی‌استیک، دکمه ===== */
.pn-ctl-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pn-seg { padding: 6px 10px; border-radius: 10px; font-size: 11px; font-weight: 800; color: #cbd5e1; background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(250, 204, 21, 0.22); }
.pn-seg.is-active { color: #fde047; border-color: rgba(250, 204, 21, 0.7); background: rgba(250, 204, 21, 0.14); }
.pn-vol { width: 70px; accent-color: #facc15; vertical-align: middle; }
/* shell در RTL است: flex-start = لبهٔ راست (راست‌دست)، flex-end = لبهٔ چپ (چپ‌دست) */
.pn-joy { display: none; justify-content: flex-start; touch-action: none; user-select: none; -webkit-user-select: none; }
.pn-ctl-joystick .pn-joy { display: flex; }
.pn-left-hand .pn-joy { justify-content: flex-end; }
.pn-joy-base { position: relative; width: 150px; height: 150px; border-radius: 50%; touch-action: none;
    background: radial-gradient(circle at 50% 50%, rgba(250, 204, 21, 0.08), rgba(15, 23, 42, 0.9) 70%);
    border: 2px solid rgba(250, 204, 21, 0.4); box-shadow: 0 0 22px -8px rgba(250, 204, 21, 0.6), inset 0 0 18px rgba(0, 0, 0, 0.7); }
.pn-joy-thumb { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 70%); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 14px rgba(250, 204, 21, 0.5); }
.pn-joy.is-held .pn-joy-base { border-color: #fde047; }
.pn-joy, .pn-joy * { touch-action: none; }
.pn-pad { display: none; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(2, 54px); gap: 6px; justify-content: center; }
.pn-ctl-dpad .pn-pad { display: grid; }
.pn-pad button {
    border-radius: 14px; font-size: 20px; font-weight: 900; touch-action: none;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(250, 204, 21, 0.3); box-shadow: 0 4px 0 rgba(2, 6, 18, 0.9);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.pn-pad button.is-pressed { transform: translateY(3px); box-shadow: 0 1px 0 rgba(2, 6, 18, 0.9); background: rgba(250, 204, 21, 0.25); }
.pn-pad [data-t="up"] { grid-column: 2; grid-row: 1; }
.pn-pad [data-t="left"] { grid-column: 1; grid-row: 2; }
.pn-pad [data-t="down"] { grid-column: 2; grid-row: 2; }
.pn-pad [data-t="right"] { grid-column: 3; grid-row: 2; }

/* ===== کارت‌های سایدبار (ستون راست و چپ) — تم روز/شب با توکن‌ها ===== */
.pn-card, .pn-lcard, .pn-intro, .pn-tips {
    min-width: 0;
    padding: 16px;
    border-radius: var(--qb-radius-card, 20px);
    background: var(--qb-surface-muted, #f8fafc);
    border: 1px solid var(--pn-line);
    color: var(--pn-ink);
}
.pn-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 900; color: var(--pn-ink); }
.pn-refresh { font-size: 14px; line-height: 1; color: var(--pn-muted); background: none; }
.pn-lb-tabs { display: flex; gap: 4px; margin: 6px 0; }
.pn-lb-tabs button { flex: 1; padding: 5px 0; font-size: 10px; font-weight: 800; border-radius: 8px; color: var(--pn-muted); background: var(--pn-row); }
.pn-lb-tabs button.is-active { color: #1c1917; background: #fde047; }
.pn-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.pn-lb li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 9px; font-size: 11px; background: var(--pn-row); }
.pn-lb li.pn-empty { display: block; }
.pn-lb li.is-me { border: 1px solid rgba(250, 204, 21, 0.5); background: rgba(250, 204, 21, 0.1); }
.pn-lb-rank { text-align: center; font-weight: 900; }
.pn-lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-lb-name em, .pn-rec-name em { display: block; font-style: normal; font-size: 9px; color: var(--pn-muted); }
.pn-lb-score { color: var(--pn-gold); font-variant-numeric: tabular-nums; }
.pn-empty { font-size: 10px; color: var(--pn-muted); text-align: center; padding: 6px 0; }
.pn-relics { display: flex; flex-wrap: wrap; gap: 5px; }
.pn-relic { font-size: 18px; }

/* ===== ستون چپ: معرفی و نکتهٔ کنترل‌ها ===== */
.pn-intro { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 24px; }
.pn-intro-badge { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; color: var(--pn-gold); background: rgba(250, 204, 21, 0.12); border: 1px solid rgba(250, 204, 21, 0.35); }
.pn-intro h2 { margin: 0; font-size: 20px; font-weight: 900; color: var(--qb-text, #0f172a); }
.pn-intro p { margin: 0; font-size: 12px; line-height: 2; color: var(--pn-muted); }
.pn-intro p strong { color: var(--pn-ink); }
.pn-intro-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pn-hchip { padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; color: var(--pn-ink); background: var(--pn-row); border: 1px solid var(--pn-line); }
.pn-hstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pn-hstat { padding: 8px 4px; border-radius: 14px; text-align: center; background: var(--pn-row); border: 1px solid var(--pn-line); min-width: 0; }
.pn-hstat span { display: block; font-size: 9px; color: var(--pn-muted); }
.pn-hstat strong { font-size: 15px; color: var(--pn-gold); font-variant-numeric: tabular-nums; }
.pn-intro-link { display: block; text-align: center; padding: 8px; border-radius: 12px; font-size: 11px; font-weight: 800; text-decoration: none; color: var(--pn-gold); background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.3); }
.pn-tips h3 { margin: 0 0 8px; font-size: 13px; font-weight: 900; color: var(--pn-ink); }
.pn-tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 11px; line-height: 1.9; color: var(--pn-muted); }
.pn-tips b { color: var(--pn-ink); }

/* ===== فهرست رکوردهای سروری (ستون راست) ===== */
.pn-lcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pn-lcard-head h3 { margin: 0; font-size: 13px; font-weight: 900; color: var(--pn-ink); }
.pn-lcard-head span { font-size: 9px; color: var(--pn-muted); text-align: left; }
.pn-records { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.pn-records li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: 12px; background: var(--pn-row); }
.pn-rank { text-align: center; font-weight: 900; }
.pn-records b { color: var(--pn-gold); font-variant-numeric: tabular-nums; }
.pn-rec-empty { display: block !important; text-align: center; color: var(--pn-muted); }

/* ===== ویجت دوئل در ستون باریک سایدبار ===== */
.qb-pacman-3col-layout [data-score-duel] { padding: 16px !important; }
.qb-pacman-3col-layout [data-score-duel] > div:first-child { flex-direction: column !important; align-items: stretch !important; }
.qb-pacman-3col-layout [data-score-duel] [role="tablist"] { width: 100% !important; }

/* ===== بهینه‌سازی دقیق نسخهٔ موبایل و دستگاه‌های لمسی ===== */
@media (hover: none), (max-width: 880px) {
    .pn-shell {
        padding: 8px 6px !important;
        border-radius: 20px !important;
    }
    .pn-head {
        margin-bottom: 6px !important;
        gap: 4px !important;
    }
    .pn-chip {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    .pn-head-actions {
        gap: 4px !important;
    }
    .pn-ico {
        width: 32px !important;
        height: 32px !important;
        font-size: 13.5px !important;
        border-radius: 9px !important;
    }
    /* روی موبایل اسلایدر صدا فضا را شلوغ می‌کند */
    .pn-shell .pn-vol,
    input.pn-vol,
    .pn-vol {
        display: none !important;
    }
    .pn-hud {
        gap: 4px !important;
        margin-bottom: 6px !important;
    }
    .pn-stat {
        padding: 3px 5px !important;
        border-radius: 9px !important;
    }
    .pn-stat span {
        font-size: 9px !important;
    }
    .pn-stat strong {
        font-size: 12.5px !important;
    }
    .pn-stat-score strong {
        font-size: 13.5px !important;
    }
    .pn-flow {
        margin-bottom: 6px !important;
    }
    .pn-frame {
        padding: 4px !important;
        border-radius: 16px !important;
        /* بورد با محاسبه دقیق ارتفاع عمودی، همراه با کنترل‌ها بدون اسکرول در صفحه جا می‌شود */
        max-width: min(100%, 340px, calc(46vh * 19 / 21)) !important;
    }
    .pn-overlay {
        inset: 4px !important;
    }

    /* مدال شروع در موبایل: بسیار فشرده، خوانا و بدون اسکرول */
    .pn-panel-start {
        padding: 10px 12px !important;
        border-radius: 18px !important;
        max-width: 295px !important;
    }
    .pn-start-glow {
        width: 130px !important;
        height: 60px !important;
    }
    .pn-brand-row {
        gap: 6px !important;
        margin-bottom: 6px !important;
    }
    .pn-start-logo {
        font-size: 26px !important;
    }
    .pn-start-titles h4 {
        font-size: 16px !important;
    }
    .pn-start-titles p {
        font-size: 8px !important;
    }
    .pn-modes {
        gap: 4px !important;
        margin-bottom: 6px !important;
        padding: 2px !important;
    }
    .pn-mode {
        padding: 5px 2px !important;
    }
    .pn-mode-ico {
        font-size: 14px !important;
        margin-bottom: 2px !important;
    }
    .pn-mode b {
        font-size: 10px !important;
    }
    .pn-mode-desc {
        font-size: 9.5px !important;
        padding: 3px 6px !important;
        margin-bottom: 8px !important;
    }
    .pn-root .pn-play,
    .pn-panel .pn-play,
    .pn-play {
        padding: 9px 14px !important;
        border-radius: 12px !important;
        font-size: 14.5px !important;
        box-shadow: 0 4px 0 #b45309, 0 8px 16px -4px rgba(250, 204, 21, 0.6) !important;
    }
    .pn-play-icon {
        font-size: 15px !important;
    }
    .pn-play-label {
        font-size: 14px !important;
    }
    .pn-hint {
        font-size: 9px !important;
        margin-top: 5px !important;
    }

    /* نوار کنترل‌های لمسی در موبایل: یک‌ردیفه و بدون شکستگی */
    .pn-ctl-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 5px !important;
        margin-top: 6px !important;
        padding: 0 2px !important;
    }
    .pn-ctl-bar button {
        padding: 5px 8px !important;
        font-size: 10px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        flex: 1 1 auto !important;
        max-width: 80px !important;
    }

    /* جوی‌استیک بهینه‌شده لمسی: متناسب و بدون هل دادن صفحه */
    .pn-joy {
        margin-top: 6px !important;
        justify-content: center !important;
    }
    .pn-joy-base {
        width: 105px !important;
        height: 105px !important;
        border: 2px solid rgba(250, 204, 21, 0.45) !important;
        background: radial-gradient(circle, rgba(250, 204, 21, 0.12) 0%, rgba(15, 23, 42, 0.8) 70%) !important;
        box-shadow: 0 0 16px -4px rgba(250, 204, 21, 0.3) !important;
    }
    .pn-joy-thumb {
        width: 44px !important;
        height: 44px !important;
        margin: -22px 0 0 -22px !important;
        border: 2px solid #fde047 !important;
        background: linear-gradient(180deg, #fef08a 0%, #facc15 60%, #eab308 100%) !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 10px rgba(250, 204, 21, 0.8) !important;
    }

    /* پد ۴ جهته فشرده در موبایل */
    .pn-pad {
        margin-top: 6px !important;
        grid-template-columns: repeat(3, 44px) !important;
        grid-template-rows: repeat(2, 38px) !important;
        gap: 4px !important;
        justify-content: center !important;
    }
    .pn-pad button {
        border-radius: 9px !important;
        font-size: 15px !important;
    }
}

/* ===== حرکت کم ===== */
@media (prefers-reduced-motion: reduce) {
    .pn-hype.is-show { animation-duration: 0.9s; }
    .pn-timer.is-danger { animation: none; }
    .pn-play, .pn-mode, .pn-upgrade, .pn-pad button, .pn-bar i, .pn-flow-tier { transition: none; }
}

/* ===== جوی‌استیک و کنترل‌های لمسی: در وب دسکتاپ مخفی است و فقط در موبایل/لمسی می‌آید ===== */
@media (hover: hover) and (min-width: 881px) {
    .pn-ctl-bar,
    .pn-joy,
    .pn-pad {
        display: none !important;
    }
}

/* ===== حالت بزرگ‌نمایی / تمام‌صفحه مانند پرتاب طلایی (game-expand.js) ===== */
.qb-expanded#pacman-neon-stage,
.qb-expanded#pacman-neon-root {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #03060f !important;
}
.qb-expanded .pn-shell {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    border-radius: 16px !important;
    padding: 10px 14px !important;
}

@media (max-width: 640px) {
    .qb-expanded .pn-shell {
        padding: 6px !important;
        border-radius: 0 !important;
    }
    .qb-expanded .pn-frame {
        max-height: calc(100% - 70px) !important;
        max-width: min(100%, calc((100% - 70px) * 19 / 21)) !important;
    }
}

.qb-expanded .pn-frame {
    flex: 1 1 auto !important;
    max-height: calc(100% - 90px) !important;
    max-width: min(100%, calc((100% - 90px) * 19 / 21)) !important;
    aspect-ratio: 19 / 21 !important;
    height: auto !important;
    margin: auto !important;
}
