:root {
    --ink: #1a1410;
    --ink-soft: #2a211c;
    --panel: #241c17;
    --panel-2: #31261f;
    --line: rgba(255, 232, 200, 0.12);
    --text: #f6efe6;
    --muted: #b9a894;
    --saffron: #e8a54b;
    --saffron-hot: #f0b85f;
    --coral: #e85d4c;
    --mint: #5ecf9a;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --font: "Vazirmatn FD", "Vazirmatn", Tahoma, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --theme-color: #1a1410;
    --surface-inset: rgba(0, 0, 0, 0.28);
    --surface-inset-soft: rgba(0, 0, 0, 0.18);
    --surface-mid: rgba(0, 0, 0, 0.22);
    --surface-deep: rgba(0, 0, 0, 0.25);
    --surface-faint: rgba(0, 0, 0, 0.16);
    --surface-strong: rgba(0, 0, 0, 0.32);
    --card-face: linear-gradient(180deg, rgba(49, 38, 31, 0.95), rgba(36, 28, 23, 0.98));
    --sheet-face: linear-gradient(165deg, #2a211c 0%, #1a1410 55%, #15110e 100%);
    --profile-face-bg: linear-gradient(160deg, rgba(49, 38, 31, 0.95), rgba(26, 20, 16, 0.98));
    --profile-ring-hole: #241c17;
    --profile-sheet-face: radial-gradient(ellipse 90% 55% at 50% -10%, rgba(232, 165, 75, 0.28), transparent 55%),
        linear-gradient(180deg, #3a2d24 0%, #241c17 42%, #1a1410 100%);
    --overlay-scrim: rgba(0, 0, 0, 0.58);
    --overlay-heavy: rgba(0, 0, 0, 0.92);
    --chip-text: #fff3df;
    --heading-strong: #fff3df;
    --glow-a: rgba(232, 165, 75, 0.22);
    --glow-b: rgba(255, 232, 200, 0.03);
    --brand-grad: linear-gradient(120deg, #fff8ea 8%, #ffe08a 38%, var(--saffron) 68%, var(--coral) 100%);
    --honor-card-border: rgba(232, 93, 76, 0.22);
    --honor-card-bg:
        radial-gradient(ellipse 90% 60% at 50% -20%, rgba(232, 93, 76, 0.16), transparent 55%),
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(232, 165, 75, 0.12), transparent 58%),
        linear-gradient(168deg, rgba(38, 28, 24, 0.99) 0%, rgba(18, 14, 12, 1) 100%);
    --honor-card-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 120, 90, 0.06) inset;
    --honor-card-bar: linear-gradient(
        90deg,
        rgba(232, 93, 76, 0.15) 0%,
        rgba(255, 120, 90, 0.85) 18%,
        rgba(255, 232, 180, 1) 50%,
        rgba(255, 120, 90, 0.85) 82%,
        rgba(232, 93, 76, 0.15) 100%
    );
    --honor-head-border: rgba(255, 120, 90, 0.12);
    --honor-title-shadow: rgba(232, 93, 76, 0.18);
    --honor-hint: rgba(185, 168, 148, 0.88);
    --honor-kicker-fg: #ffb4a6;
    --honor-kicker-bg: rgba(232, 93, 76, 0.14);
    --honor-kicker-border: rgba(232, 93, 76, 0.28);
    --honor-live-dot: var(--coral);
    --honor-live-pulse: rgba(232, 93, 76, 0.55);
    --honor-command-bg: var(--surface-inset);
    --honor-command-border: var(--line);
    --honor-cta-bg: linear-gradient(135deg, var(--saffron), #d9892f);
    --honor-cta-color: #fff;
    --honor-cta-ring: rgba(232, 165, 75, 0.35);
    --honor-cta-glow: rgba(232, 165, 75, 0.42);
    --honor-cta-shadow: 0 0 0 1px var(--honor-cta-ring), 0 0 22px var(--honor-cta-glow), 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    --honor-cta-shadow-hover: 0 0 0 1px rgba(232, 165, 75, 0.5), 0 0 30px rgba(232, 165, 75, 0.55), 0 10px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    --honor-rank-color: var(--text);
    --honor-gap: var(--coral);
    --honor-gap-glow: rgba(232, 93, 76, 0.55);
    --honor-bar-track: rgba(255, 255, 255, 0.08);
    --honor-bar-track-border: rgba(255, 255, 255, 0.05);
    --honor-bar-fill: linear-gradient(90deg, #c8782a, var(--saffron), var(--saffron-hot));
    --honor-bar-glow: rgba(232, 165, 75, 0.65);
    --honor-tile-border: var(--line);
    --honor-tile-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 100%);
    --honor-tile-fg: var(--text);
    --honor-tile-name: var(--muted);
    --honor-tile-sub: rgba(246, 239, 230, 0.72);
    --honor-tile-sub-muted: rgba(246, 239, 230, 0.42);
    --honor-leader: var(--saffron-hot);
    --honor-leader-glow: rgba(232, 165, 75, 0.55);
    --honor-rank: var(--saffron-hot);
    --honor-rank-glow: rgba(232, 165, 75, 0.35);
    --honor-score-strong: #ffe9b8;
    --honor-tile-hover-border: rgba(232, 165, 75, 0.35);
    --honor-tile-hover-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.1) 0%, rgba(232, 165, 75, 0.06) 100%);
    --honor-leader-pulse: rgba(232, 165, 75, 0.18);
    --honor-strip-line: rgba(255, 255, 255, 0.012);
    --honor-empty: var(--muted);

    /* نقشه رقابت (auth-race-map) — تم کلاسیک */
    --arm-bg:
        linear-gradient(180deg, rgba(255, 248, 235, 0.03), transparent 42%),
        linear-gradient(165deg, rgba(34, 28, 24, 0.92), rgba(22, 18, 16, 0.96));
    --arm-border: rgba(232, 165, 75, 0.16);
    --arm-title: #f4ece1;
    --arm-caption: rgba(185, 168, 148, 0.9);
    --arm-ends: rgba(185, 168, 148, 0.72);
    --arm-line: linear-gradient(90deg, rgba(196, 122, 42, 0.25), rgba(232, 165, 75, 0.85) 48%, rgba(240, 194, 122, 0.95));
    --arm-dot-start: rgba(232, 165, 75, 0.7);
    --arm-dot-end: rgba(154, 196, 214, 0.85);
    --arm-marker: #d8a45a;
    --arm-marker-border: rgba(255, 244, 220, 0.55);
    --arm-marker-ring: rgba(232, 165, 75, 0.12);
    --arm-marker-glow: rgba(232, 165, 75, 0.28);
    --arm-leader: #8eb8c9;
    --arm-leader-border: rgba(230, 245, 250, 0.7);
    --arm-leader-ring: rgba(142, 184, 201, 0.16);
    --arm-leader-glow: rgba(142, 184, 201, 0.35);
    --arm-rank-fg: rgba(246, 239, 230, 0.92);
    --arm-rank-bg: rgba(22, 18, 16, 0.82);
    --arm-rank-border: rgba(232, 165, 75, 0.28);
    --arm-leader-rank-fg: #e8f3f7;
    --arm-leader-rank-border: rgba(142, 184, 201, 0.45);
    --arm-leader-rank-bg: rgba(18, 28, 34, 0.88);
    --arm-row-bg: rgba(255, 255, 255, 0.03);
    --arm-row-border: rgba(246, 239, 230, 0.06);
    --arm-leader-row-bg: rgba(142, 184, 201, 0.1);
    --arm-leader-row-border: rgba(142, 184, 201, 0.28);
    --arm-row-rank-fg: rgba(185, 168, 148, 0.95);
    --arm-leader-row-rank-fg: #b8d8e4;
    --arm-row-name: rgba(246, 239, 230, 0.95);
    --arm-leader-row-name: #eef6f9;
    --arm-bar-track: rgba(255, 255, 255, 0.06);
    --arm-bar-fill: linear-gradient(90deg, rgba(196, 122, 42, 0.55), rgba(232, 165, 75, 0.95));
    --arm-leader-bar-fill: linear-gradient(90deg, rgba(110, 158, 176, 0.65), rgba(142, 184, 201, 0.98));
    --arm-row-score: rgba(246, 239, 230, 0.88);
    --arm-leader-row-score: #d8ebf2;
    --arm-legend-item-fg: rgba(185, 168, 148, 0.88);
    --arm-legend-border: rgba(246, 239, 230, 0.06);
    --arm-swatch-peer: #d8a45a;
    --arm-swatch-peer-ring: rgba(232, 165, 75, 0.18);
    --arm-swatch-lead: #8eb8c9;
    --arm-swatch-lead-ring: rgba(142, 184, 201, 0.2);
    --arm-focus-outline: rgba(246, 239, 230, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    background: var(--ink);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

html {
    /* جلوگیری از اسکرول افقی بدون کلیپ‌کردن لایه‌های fixed تم */
    overflow-x: clip;
}

body {
    min-height: 100dvh;
    overflow-x: visible;
    overflow-y: auto;
    /* گرادیان تم‌ها روی ::before ثابت می‌نشیند تا همیشه تمام viewport را بپوشاند */
}

/* بوم پس‌زمینه ثابت — تم‌ها گرادیان خود را اینجا می‌کشند */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: transparent;
}

.bg-glow {
    position: fixed;
    top: -8%;
    left: -10%;
    right: auto;
    bottom: auto;
    width: min(78vw, 520px);
    height: min(78vw, 520px);
    background: radial-gradient(circle, var(--glow-a), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--glow-b) 1px, transparent 1px),
        linear-gradient(90deg, var(--glow-b) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 92%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 92%);
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    max-width: 100%;
    margin: 0 auto;
    min-height: 100dvh;
    padding: 16px 16px calc(16px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-x: clip;
}

@media (max-width: 520px) {
    .bg-glow {
        top: -4%;
        left: -6%;
        width: min(88vw, 420px);
        height: min(88vw, 420px);
    }

    .bg-grid {
        -webkit-mask-image: radial-gradient(ellipse at center, black 48%, transparent 96%);
        mask-image: radial-gradient(ellipse at center, black 48%, transparent 96%);
    }
}

.ad-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(77, 141, 255, 0.18), rgba(232, 165, 75, 0.12));
    border: 1px solid rgba(77, 141, 255, 0.28);
    color: var(--text, #f2ebe3);
    font-size: 0.9rem;
    line-height: 1.45;
}

.ad-banner.is-hidden,
.ad-banner[hidden] {
    display: none !important;
}

.ad-banner.is-image {
    align-items: flex-start;
}

.ad-banner.is-special {
    border-color: rgba(232, 165, 75, 0.45);
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.2), rgba(77, 141, 255, 0.12));
}

.ad-banner.is-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.ad-banner-media {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
}

.ad-banner-body {
    flex: 1;
    min-width: 0;
}

.ad-banner-title {
    margin: 0;
    font-weight: 800;
    font-size: 0.92rem;
}

.ad-banner-text {
    margin: 4px 0 0;
    opacity: 0.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.ad-banner.is-single .ad-banner-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-banner-link {
    color: inherit;
    text-decoration: none;
    display: contents;
}

.ad-banner-dismiss {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    flex-shrink: 0;
}

.ad-banner-dismiss:hover { opacity: 1; }

.top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.brand-block { min-width: 0; }

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.brand-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-avatar {
    position: relative;
    width: clamp(72px, 20vw, 96px);
    aspect-ratio: 1;
    border-radius: 0;
    overflow: visible;
    flex-shrink: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.brand-mark {
    margin: 0;
    font-size: clamp(2.2rem, 9vw, 3.1rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(232, 165, 75, 0.28));
}

.brand-mark.is-plain {
    font-size: clamp(2.2rem, 9vw, 3.1rem);
}

.brand-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-version {
    margin-top: 0;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--muted);
    opacity: 0.85;
    direction: ltr;
    unicode-bidi: isolate;
}

.brand-version-age {
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.9;
    margin-inline-start: 4px;
    direction: rtl;
    unicode-bidi: isolate;
}

.brand-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.top-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.top-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-guide {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(232, 165, 75, 0.45);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.22), rgba(232, 165, 75, 0.08));
    color: #fff3df;
    font: inherit;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(232, 165, 75, 0.18);
}

.btn-guide:hover {
    border-color: rgba(232, 165, 75, 0.75);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 165, 75, 0.28);
}

.btn-rules {
    height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(232, 120, 90, 0.45);
    background: linear-gradient(180deg, rgba(232, 120, 90, 0.22), rgba(232, 120, 90, 0.08));
    color: #ffe8df;
    font: inherit;
    font-weight: 750;
    font-size: 0.76rem;
    line-height: 1;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(232, 120, 90, 0.16);
    white-space: nowrap;
}

.btn-rules:hover {
    border-color: rgba(232, 120, 90, 0.78);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 120, 90, 0.28);
}

.btn-support {
    height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(110, 168, 255, 0.45);
    background: linear-gradient(180deg, rgba(110, 168, 255, 0.22), rgba(110, 168, 255, 0.08));
    color: #e4f0ff;
    font: inherit;
    font-weight: 750;
    font-size: 0.76rem;
    line-height: 1;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(110, 168, 255, 0.16);
    white-space: nowrap;
}

.btn-support:hover {
    border-color: rgba(110, 168, 255, 0.78);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(110, 168, 255, 0.28);
}

.btn-dash {
    height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(180, 140, 255, 0.45);
    background: linear-gradient(180deg, rgba(180, 140, 255, 0.22), rgba(180, 140, 255, 0.08));
    color: #f0e8ff;
    font: inherit;
    font-weight: 750;
    font-size: 0.76rem;
    line-height: 1;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 14px rgba(180, 140, 255, 0.16);
    white-space: nowrap;
}
.btn-dash:hover,
.btn-dash.is-on {
    border-color: rgba(180, 140, 255, 0.85);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(180, 140, 255, 0.3);
}
.btn-dash.is-on {
    background: linear-gradient(180deg, rgba(180, 140, 255, 0.38), rgba(180, 140, 255, 0.16));
}

/* منوی کوچک داشبورد زیر دکمه */
.dash-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 30;
}
.dash-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scaleY(0.6);
    transform-origin: top center;
    min-width: 132px;
    width: max-content;
    max-width: min(200px, 70vw);
    opacity: 0;
    pointer-events: none;
    z-index: 31;
    background: var(--card-face);
    border: 1px solid rgba(180, 140, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition:
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease;
}
.dash-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scaleY(1);
}
.dash-panel-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    min-height: 0;
}
.dash-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.dash-item:hover {
    background: rgba(180, 140, 255, 0.16);
}
.dash-item#guide-btn {
    font-size: 1rem;
    font-weight: 800;
}

.btn-leaderboard {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(94, 207, 154, 0.4);
    background: linear-gradient(180deg, rgba(94, 207, 154, 0.2), rgba(94, 207, 154, 0.08));
    color: #dfffee;
    font: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(94, 207, 154, 0.14);
    white-space: nowrap;
}

.btn-leaderboard:hover {
    border-color: rgba(94, 207, 154, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(94, 207, 154, 0.24);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.14), rgba(255, 243, 223, 0.05));
    border: 1px solid rgba(232, 165, 75, 0.28);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: min(220px, 58vw);
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.user-chip.is-hidden { display: none; }
.user-chip:hover {
    border-color: rgba(232, 165, 75, 0.65);
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.22), rgba(255, 243, 223, 0.08));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(232, 165, 75, 0.18);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sfx-toggle-fab {
    height: 34px;
    border: 1px solid rgba(94, 207, 154, 0.45);
    background: linear-gradient(180deg, rgba(26, 42, 35, 0.92), rgba(17, 28, 23, 0.92));
    color: #dcf8ea;
    border-radius: 999px;
    padding: 0 10px;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
    transition: transform 0.12s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.sfx-toggle-fab:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 207, 154, 0.75);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.sfx-toggle-fab.is-off {
    opacity: 0.86;
    border-color: rgba(255, 145, 126, 0.45);
    color: #ffe1d8;
}

.btn-insects {
    height: 34px;
    border: 1px solid rgba(232, 165, 75, 0.45);
    background: linear-gradient(180deg, rgba(42, 32, 18, 0.92), rgba(24, 18, 12, 0.92));
    color: #fff3df;
    border-radius: 999px;
    padding: 0 10px;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
    transition: transform 0.12s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}
.btn-insects:hover {
    transform: translateY(-1px);
    border-color: rgba(232, 165, 75, 0.75);
}
.btn-insects.is-off {
    opacity: 0.86;
    border-color: rgba(255, 145, 126, 0.45);
    color: #ffe1d8;
}

.my-insects-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(6, 8, 10, 0.62);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.my-insects-sheet {
    width: min(440px, 100%);
    max-height: min(78vh, 640px);
    overflow: auto;
    background: linear-gradient(165deg, #1a221c 0%, #121816 100%);
    border: 1px solid rgba(120, 180, 140, 0.28);
    border-radius: 18px 18px 14px 14px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    padding: 14px 14px 18px;
}

.my-insects-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.my-insects-head strong {
    display: block;
    font-size: 1.05rem;
    color: #e8f5ea;
}

.my-insects-sub {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: rgba(200, 220, 205, 0.75);
}

.my-insects-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #dfe8e2;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.my-insects-note {
    margin: 0 0 12px;
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(190, 210, 198, 0.8);
}

.my-insects-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-insect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.my-insect-row.is-unlocked.is-on {
    border-color: rgba(90, 190, 120, 0.35);
    background: rgba(40, 90, 55, 0.18);
}

.my-insect-row.is-locked {
    opacity: 0.78;
}

.my-insect-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.my-insect-name {
    font-size: 0.9rem;
    color: #f0f7f2;
}

.my-insect-hint {
    font-size: 0.72rem;
    color: rgba(180, 200, 188, 0.78);
}

.my-insect-switch {
    flex: 0 0 auto;
    min-width: 72px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 160, 120, 0.35);
    background: rgba(60, 28, 22, 0.65);
    color: #ffd8cc;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.my-insect-switch.is-on {
    border-color: rgba(90, 200, 130, 0.5);
    background: rgba(28, 70, 42, 0.85);
    color: #d8ffe6;
}

.my-insect-lock {
    font-size: 1.1rem;
}

.my-insect-empty {
    padding: 16px;
    text-align: center;
    color: rgba(190, 210, 198, 0.75);
    font-size: 0.85rem;
}

.stage { flex: 1; display: flex; flex-direction: column; }
.stage.is-home-transit {
    transition:
        opacity 0.3s ease,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.stage.is-home-leave-forward {
    opacity: 0;
    transform: translate3d(-12px, 6px, 0) scale(0.985);
    pointer-events: none;
}
.stage.is-home-leave-back {
    opacity: 0;
    transform: translate3d(12px, 6px, 0) scale(0.985);
    pointer-events: none;
}
.stage.is-home-enter-forward {
    opacity: 0;
    transform: translate3d(18px, 10px, 0) scale(0.985);
    pointer-events: none;
}
.stage.is-home-enter-back {
    opacity: 0;
    transform: translate3d(-18px, 10px, 0) scale(0.985);
    pointer-events: none;
}
.stage.is-home-show {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}
.stage.is-phase-transit {
    transition:
        opacity 0.36s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.stage.is-phase-leave {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(0.985);
    pointer-events: none;
}
.stage.is-phase-show {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .stage.is-home-transit,
    .stage.is-phase-transit {
        transition: none;
    }
}

.home-honor-host.card {
    margin-bottom: 10px;
    padding: 0;
    overflow: visible;
    border-color: var(--honor-card-border);
    background: var(--honor-card-bg);
    box-shadow: var(--honor-card-shadow);
}
.home-honor-host.card::before {
    content: "";
    display: block;
    height: 3px;
    background: var(--honor-card-bar);
}
.home-honor-host .honor-launcher.is-home {
    margin: 0;
    padding: 14px 18px 22px;
    text-align: right;
    position: relative;
    overflow: visible;
}
.home-honor-host .honor-launcher.is-competitive::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        -18deg,
        transparent,
        transparent 28px,
        var(--honor-strip-line) 28px,
        var(--honor-strip-line) 29px
    );
    mask-image: linear-gradient(to bottom, black 0%, transparent 88%);
}
.home-honor-host .honor-launcher-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--honor-head-border);
    position: relative;
    z-index: 1;
    text-align: center;
}
.home-honor-host .honor-launcher-head-copy {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.home-honor-host .honor-launcher-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--honor-kicker-fg);
    background: var(--honor-kicker-bg);
    border: 1px solid var(--honor-kicker-border);
}
.home-honor-host .honor-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--honor-live-dot);
    box-shadow: 0 0 0 0 var(--honor-live-pulse);
    animation: honor-live-pulse 1.8s ease-out infinite;
}
@keyframes honor-live-pulse {
    0% { box-shadow: 0 0 0 0 var(--honor-live-pulse); }
    70% { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}
.home-honor-host .honor-launcher-arena-badge {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: rgba(255, 220, 200, 0.55);
    background: linear-gradient(145deg, rgba(232, 93, 76, 0.22), rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(232, 93, 76, 0.28);
    transform: rotate(-8deg);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.home-honor-host .honor-launcher-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--heading-strong);
    text-shadow: 0 2px 12px var(--honor-title-shadow);
    text-align: center;
}
.home-honor-host .honor-launcher-hint {
    margin: 4px 0 0;
    font-size: 0.67rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--honor-hint);
    text-align: center;
}
.home-honor-host .honor-battle-command {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--honor-command-border);
    background: var(--honor-command-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 0;
}
.home-honor-host .honor-battle-duo {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    min-width: 0;
}
.home-honor-host .honor-battle-status-card {
    min-width: 0;
    padding: 4px 2px;
}
.home-honor-host .honor-battle-cta {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
    color: #f3fff7;
    background: linear-gradient(135deg, #34d399 0%, #16a34a 55%, #15803d 100%);
    box-shadow:
        0 0 0 2px rgba(52, 211, 153, 0.55),
        0 0 22px rgba(34, 197, 94, 0.55),
        0 8px 18px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: honor-cta-halo 1.45s ease-in-out infinite;
    transition: filter 0.15s ease, transform 0.12s ease;
}
.home-honor-host .honor-battle-cta::before {
    content: '';
    position: absolute;
    inset: -6px;
    z-index: -1;
    border-radius: 18px;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: honor-cta-ring 1.45s ease-out infinite;
}
.home-honor-host .honor-battle-cta:hover {
    filter: brightness(1.08);
}
.home-honor-host .honor-battle-cta:active {
    transform: scale(0.985);
}
@keyframes honor-cta-halo {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(52, 211, 153, 0.45),
            0 0 14px rgba(34, 197, 94, 0.35),
            0 8px 18px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(52, 211, 153, 0.2),
            0 0 34px rgba(74, 222, 128, 0.85),
            0 10px 22px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}
@keyframes honor-cta-ring {
    0% {
        opacity: 0.9;
        transform: scale(0.96);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65);
    }
    70% {
        opacity: 0;
        transform: scale(1.12);
        box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
    }
    100% {
        opacity: 0;
        transform: scale(1.12);
        box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
    }
}
@media (prefers-reduced-motion: reduce) {
    .home-honor-host .honor-battle-cta,
    .home-honor-host .honor-battle-cta::before {
        animation: none;
    }
}
.home-honor-host .honor-battle-status {
    min-width: 0;
}
.home-honor-host .honor-battle-rank {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--honor-rank-color);
    line-height: 1.45;
}
.home-honor-host .honor-battle-gap {
    margin: 4px 0 0;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--honor-gap);
    line-height: 1.35;
    text-shadow: 0 0 12px var(--honor-gap-glow);
}
.home-honor-host .honor-battle-bar {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: var(--honor-bar-track);
    border: 1px solid var(--honor-bar-track-border);
    overflow: hidden;
}
.home-honor-host .honor-battle-bar > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--honor-bar-fill);
    box-shadow: 0 0 12px var(--honor-bar-glow);
    transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (max-width: 720px) {
    .home-honor-host .honor-battle-duo {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .home-honor-host .honor-battle-duo {
        grid-template-columns: 1fr;
    }
}
.home-honor-host .honor-launcher-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    position: relative;
    z-index: 1;
}
.home-honor-host .honor-tile.is-competitive {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 8px 10px;
    min-width: 0;
    min-height: 0;
    padding: 12px 10px;
    border-radius: 16px;
    border: 1px solid var(--honor-tile-border);
    background: var(--honor-tile-bg);
    color: var(--honor-tile-fg);
    text-align: right;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 10px 26px rgba(0, 0, 0, 0.24);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.18s ease,
        box-shadow 0.2s ease;
}
.home-honor-host .honor-tile.is-competitive::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    opacity: 0.55;
}
.home-honor-host .honor-tile.is-competitive:hover,
.home-honor-host .honor-tile.is-competitive:focus-visible {
    border-color: var(--honor-tile-hover-border);
    background: var(--honor-tile-hover-bg);
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 14px 28px rgba(0, 0, 0, 0.3);
    outline: none;
}
.home-honor-host .honor-tile.is-competitive.is-leader {
    animation: honor-leader-glow 2.4s ease-in-out infinite;
}
@keyframes honor-leader-glow {
    0%, 100% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 10px 26px rgba(0, 0, 0, 0.24), 0 0 0 transparent; }
    50% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 12px 28px rgba(0, 0, 0, 0.28), 0 0 18px var(--honor-leader-pulse); }
}
.home-honor-host .honor-tile.is-earned.is-gold {
    border-color: rgba(240, 193, 75, 0.4);
    background:
        radial-gradient(ellipse 70% 55% at 0% 0%, rgba(240, 193, 75, 0.18), transparent 55%),
        linear-gradient(155deg, rgba(255, 214, 102, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: #fff8ea;
}
.home-honor-host .honor-tile.is-earned.is-silver {
    border-color: rgba(197, 208, 220, 0.36);
    background:
        radial-gradient(ellipse 70% 55% at 0% 0%, rgba(197, 208, 220, 0.14), transparent 55%),
        linear-gradient(155deg, rgba(197, 208, 220, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: #f2f6fa;
}
.home-honor-host .honor-tile.is-earned.is-bronze {
    border-color: rgba(208, 138, 76, 0.38);
    background:
        radial-gradient(ellipse 70% 55% at 0% 0%, rgba(208, 138, 76, 0.14), transparent 55%),
        linear-gradient(155deg, rgba(208, 138, 76, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: #ffe8d4;
}
.home-honor-host .honor-tile.is-earned::after {
    display: none;
}
.home-honor-host .honor-tile.is-idle {
    opacity: 0.92;
}
.home-honor-host .honor-tile-podium,
.home-honor-host .honor-tile-badge {
    display: none !important;
}
.home-honor-host .honor-tile-visual {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), transparent 52%),
        rgba(255, 255, 255, 0.04);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 8px 16px rgba(0, 0, 0, 0.28);
}
.home-honor-host .honor-tile.is-earned.is-gold .honor-tile-visual {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 236, 180, 0.42), transparent 55%),
        rgba(240, 193, 75, 0.14);
    box-shadow:
        0 0 0 1px rgba(240, 193, 75, 0.35) inset,
        0 0 20px rgba(240, 193, 75, 0.22),
        0 8px 16px rgba(0, 0, 0, 0.28);
}
.home-honor-host .honor-tile.is-earned.is-silver .honor-tile-visual {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.32), transparent 55%),
        rgba(197, 208, 220, 0.12);
    box-shadow:
        0 0 0 1px rgba(197, 208, 220, 0.3) inset,
        0 0 16px rgba(197, 208, 220, 0.14),
        0 8px 16px rgba(0, 0, 0, 0.28);
}
.home-honor-host .honor-tile.is-earned.is-bronze .honor-tile-visual {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 210, 160, 0.32), transparent 55%),
        rgba(208, 138, 76, 0.12);
    box-shadow:
        0 0 0 1px rgba(208, 138, 76, 0.3) inset,
        0 0 16px rgba(208, 138, 76, 0.14),
        0 8px 16px rgba(0, 0, 0, 0.28);
}
.home-honor-host .honor-tile-icon {
    width: auto;
    height: auto;
    line-height: 0;
}
.home-honor-host .honor-tile-icon .cup-mark-svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.home-honor-host .honor-tile-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.home-honor-host .honor-tile-name {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--honor-tile-name);
    white-space: normal;
    overflow: visible;
    -webkit-line-clamp: unset;
}
.home-honor-host .honor-tile-leader {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 1.22rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--honor-leader);
    text-shadow:
        0 0 16px var(--honor-leader-glow),
        0 1px 0 rgba(0, 0, 0, 0.35);
}
.home-honor-host .honor-tile.is-empty-leader {
    opacity: 0.88;
}
.home-honor-host .honor-tile-sub {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--honor-tile-sub);
}
.home-honor-host .honor-tile-sub.is-muted {
    font-size: 0.72rem;
    color: var(--honor-tile-sub-muted);
}
.home-honor-host .honor-tile-rank {
    font-weight: 900;
    color: var(--honor-rank);
    text-shadow: 0 0 14px var(--honor-rank-glow);
}
.home-honor-host .honor-tile.is-earned.is-silver .honor-tile-rank {
    color: #eef4fb;
    text-shadow: 0 0 12px rgba(197, 208, 220, 0.3);
}
.home-honor-host .honor-tile.is-earned.is-bronze .honor-tile-rank {
    color: #ffc98a;
    text-shadow: 0 0 12px rgba(208, 138, 76, 0.28);
}
.home-honor-host .honor-tile-score {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
    padding: 0;
    font-size: 0.64rem;
    color: var(--honor-tile-sub-muted);
}
.home-honor-host .honor-tile-score strong {
    font-size: 0.92rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--honor-score-strong);
}
.home-honor-host .honor-tile-score em {
    font-style: normal;
    font-size: 0.64rem;
    font-weight: 600;
    opacity: 0.75;
}
.home-honor-host .honor-tile-rival {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    color: rgba(255, 255, 255, 0.48);
}
.home-honor-host .honor-tile-rival-text {
    min-width: 0;
}
.home-honor-host .honor-tile-rival.is-leader {
    color: rgba(255, 255, 255, 0.62);
}
.home-honor-host .honor-tile-rival-mark {
    flex-shrink: 0;
    font-size: 0.58rem;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
}
.home-honor-host .honor-tile-rival.is-leader .honor-tile-rival-text {
    font-weight: 600;
}
.home-honor-host .honor-tile-chevron {
    display: none;
}
.home-honor-host .honor-launcher.is-empty {
    padding: 16px;
}
.home-honor-host .honor-launcher-empty {
    margin: 0;
    font-size: 0.74rem;
    color: var(--honor-empty);
    text-align: center;
}

.home-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.btn-back-mini {
    flex-shrink: 0;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-back-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.home-top .welcome {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.home-top-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-logout-mini {
    flex-shrink: 0;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 120, 100, 0.45);
    background: linear-gradient(180deg, rgba(232, 93, 76, 0.28), rgba(232, 93, 76, 0.1));
    color: #ffe4de;
    font: inherit;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(232, 93, 76, 0.16);
}

.btn-logout-mini:hover {
    border-color: rgba(255, 120, 100, 0.75);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(232, 93, 76, 0.26);
}

.card {
    background: var(--card-face);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.card.rule-maker {
    position: relative;
    overflow: hidden;
    border-color: rgba(168, 120, 255, 0.72);
    background:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(168, 120, 255, 0.28), transparent 55%),
        radial-gradient(ellipse 90% 70% at 0% 100%, rgba(94, 207, 154, 0.18), transparent 50%),
        linear-gradient(165deg, rgba(42, 28, 58, 0.98) 0%, rgba(24, 36, 44, 0.99) 48%, rgba(18, 28, 34, 1) 100%);
    box-shadow:
        0 22px 48px rgba(120, 80, 200, 0.32),
        0 0 0 1px rgba(168, 120, 255, 0.12) inset;
}

.card.rule-maker::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(168, 120, 255, 0.95), rgba(94, 207, 154, 0.85), rgba(232, 165, 75, 0.75));
    pointer-events: none;
}

.card.rule-maker .title {
    color: #f0e6ff;
    text-shadow: 0 0 24px rgba(168, 120, 255, 0.35);
}

.card.rule-maker .rule-panel {
    border-color: rgba(168, 120, 255, 0.28);
    background: rgba(255, 255, 255, 0.03);
}

.card.rule-maker .rule-panel-title {
    color: #d8c4ff;
}

.card.rule-maker .dict-count-box {
    border-color: rgba(168, 120, 255, 0.35);
    background: rgba(168, 120, 255, 0.08);
}

.card.rule-maker .difficulty-fill.is-easy { background: linear-gradient(to left, #3dbf88, #5ecf9a 55%, #8ee4bc); }
.card.rule-maker .difficulty-fill.is-mid { background: linear-gradient(to left, #5ecf9a, #e8a54b 55%, #f0b85f); }
.card.rule-maker .difficulty-fill.is-hard { background: linear-gradient(to left, #5ecf9a, #e8a54b 40%, #e85d4c 78%, #ff6b5a); }

.hero-card {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 180px;
    text-align: center;
}

.loader-pulse {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(232, 165, 75, 0.2);
    border-top-color: var(--saffron);
    animation: spin 0.8s linear infinite;
}

.hint { margin: 0; color: var(--muted); font-size: 0.9rem; }

.foot {
    text-align: center;
    color: rgba(185, 168, 148, 0.55);
    font-size: 0.75rem;
}

/* —— form —— */
.seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    background: var(--surface-deep);
    border-radius: 12px;
    margin-bottom: 14px;
}

.seg-btn {
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.18s ease;
}

.seg-btn:active {
    transform: scale(0.98);
}

.seg-btn.is-on {
    background: var(--panel-2);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.seg-btn.is-join-tab {
    color: #e8c48a;
}
.seg-btn.is-join-tab.is-on {
    color: #1a1208;
    background: linear-gradient(135deg, var(--saffron), #d9892f);
    box-shadow: 0 6px 16px rgba(232, 165, 75, 0.32);
}
.seg-btn.is-create-tab {
    color: #c4b5fd;
}
.seg-btn.is-create-tab.is-on {
    color: #f5f3ff;
    background: linear-gradient(135deg, #8b7cff, #5b4bd6);
    box-shadow: 0 6px 16px rgba(91, 75, 214, 0.34);
}

.home-panels {
    position: relative;
    display: block;
    overflow: hidden;
    transition: height 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-panels.is-instant {
    transition: none !important;
}

.home-panel {
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition:
        opacity 0.42s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.42s;
}

.home-panel:not(.is-on) {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
}

.home-panel.is-on {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity 0.42s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0s;
    z-index: 1;
}

.home-panel.is-instant {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .home-panels,
    .home-panel {
        transition: none !important;
    }
}

/* سازگاری کلاس‌های قبلی */
.home-body {
    display: contents;
}

.field { margin-bottom: 12px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-inset);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.65);
}

.field input[readonly],
.readonly-field {
    opacity: 0.92;
    cursor: default;
    background: var(--surface-inset-soft);
    border-color: rgba(232, 165, 75, 0.28);
    color: var(--saffron-hot);
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}

.field-phone-locked input[readonly] {
    letter-spacing: 0.04em;
}

.capacity-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 8px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 232, 200, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 243, 223, 0.045), rgba(0, 0, 0, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 243, 223, 0.04);
}

.capacity-bar-label {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #d8c8b4;
    line-height: 1.3;
}

.capacity-bar-control {
    position: relative;
    flex: 0 0 auto;
    width: 7.75rem;
    z-index: 5;
}

.capacity-bar-control .soft-select {
    width: 100%;
}

.capacity-bar-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 38px;
    padding: 0 12px 0 30px;
    border-radius: 8px;
    border: 1px solid rgba(232, 165, 75, 0.38);
    background: rgba(10, 7, 5, 0.42);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    text-align: center;
    cursor: pointer;
}

.capacity-bar-meta {
    margin: 0 2px 14px;
    padding: 0 2px;
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.capacity-bar-meta strong {
    color: var(--saffron-hot);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    display: inline-block;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.22s ease;
}

.capacity-bar-meta strong.is-tick {
    animation: capacity-tick 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes capacity-tick {
    0% { transform: scale(0.86); opacity: 0.45; }
    55% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* —— soft select (دراپ‌داون نرم) —— */
.soft-select {
    position: relative;
    width: 100%;
    z-index: 4;
}

.soft-select.is-open {
    z-index: 40;
}

.soft-select-trigger {
    position: relative;
    width: 100%;
    height: 46px;
    padding: 0 14px 0 34px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-inset);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    text-align: right;
    cursor: pointer;
    transition:
        border-color 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.16s ease;
}

.soft-select--capacity .soft-select-trigger {
    height: 38px;
    padding: 0 12px 0 30px;
    border-radius: 8px;
    border: 1px solid rgba(232, 165, 75, 0.38);
    background: rgba(10, 7, 5, 0.42);
    font-size: 0.9rem;
    text-align: center;
}

.soft-select--char .soft-select-trigger {
    height: 40px;
    min-height: 40px;
    padding: 0 10px 0 28px;
    border-radius: 12px;
    border: 1px solid rgba(232, 165, 75, 0.45);
    background: linear-gradient(180deg, rgba(255, 233, 198, 0.18), rgba(31, 24, 20, 0.35));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff4e2;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.03em;
    text-align: center;
}

.soft-select-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 14px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid rgba(246, 239, 230, 0.78);
    border-bottom: 1.5px solid rgba(246, 239, 230, 0.78);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.soft-select--capacity .soft-select-trigger::after,
.soft-select--char .soft-select-trigger::after {
    left: 12px;
}

.soft-select.is-open .soft-select-trigger {
    border-color: rgba(232, 165, 75, 0.72);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.14);
}

.soft-select.is-open .soft-select-trigger::after {
    transform: translateY(-35%) rotate(225deg);
}

.soft-select-trigger:hover {
    border-color: rgba(232, 165, 75, 0.55);
}

.soft-select-trigger:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.72);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.14);
}

.soft-select.is-disabled .soft-select-trigger {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.soft-select.needs-letter .soft-select-trigger {
    border-color: rgba(232, 120, 90, 0.72);
    box-shadow: 0 0 0 2px rgba(232, 120, 90, 0.18);
}

.soft-select.is-locked-all .soft-select-trigger {
    border-color: rgba(185, 168, 148, 0.5);
    background: linear-gradient(180deg, rgba(185, 168, 148, 0.18), rgba(38, 32, 27, 0.45));
    color: #dfd3c4;
}

.soft-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 14px;
    border: 1px solid rgba(232, 165, 75, 0.28);
    background: linear-gradient(180deg, rgba(49, 38, 31, 0.98), rgba(26, 20, 16, 0.98));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px) scale(0.97);
    transform-origin: top center;
    pointer-events: none;
    transition:
        max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.3s ease;
}

.soft-select.is-open .soft-select-menu,
.soft-select-menu.is-open {
    max-height: 260px;
    opacity: 1;
    overflow-y: auto;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 165, 75, 0.35) transparent;
}

.soft-select-menu.is-portal {
    /* روی body؛ مختصات با JS */
    margin: 0;
}

.soft-select--char .soft-select-menu {
    min-width: 100%;
}

.soft-select-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    text-align: right;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.soft-select--capacity .soft-select-option,
.soft-select--char .soft-select-option {
    text-align: center;
}

.soft-select-option:hover {
    background: rgba(232, 165, 75, 0.14);
}

.soft-select-option.is-on {
    background: rgba(232, 165, 75, 0.22);
    color: var(--saffron-hot);
}

.soft-select-option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.soft-select-option:active:not(.is-disabled) {
    transform: scale(0.98);
}

.soft-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .soft-select-menu,
    .soft-select-trigger,
    .soft-select-trigger::after,
    .soft-select-option,
    .capacity-bar-meta strong {
        transition: none !important;
        animation: none !important;
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.birth-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 0.8fr;
    gap: 8px;
}

.field .req {
    color: #e07a6a;
}

.btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-main {
    background: linear-gradient(135deg, var(--saffron), #d9892f);
    color: #1a1208;
    box-shadow: 0 10px 24px rgba(232, 165, 75, 0.28);
}

.btn-main:hover { filter: brightness(1.05); }

.btn-soft {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-soft.is-acted,
.btn-sm.is-acted {
    background: rgba(232, 165, 75, 0.28);
    border-color: rgba(232, 165, 75, 0.9);
    color: #fff3df;
    box-shadow: 0 0 0 2px rgba(232, 165, 75, 0.22);
}

.btn-coral {
    background: linear-gradient(135deg, var(--coral), #c44738);
    color: #fff8f6;
}

.btn-create-group {
    min-height: 48px;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #8b7cff, #5b4bd6);
    color: #f5f3ff;
    box-shadow: 0 10px 24px rgba(91, 75, 214, 0.3);
}
.btn-create-group:hover { filter: brightness(1.05); }

.btn-join-group {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, var(--saffron), #d9892f);
    color: #1a1208;
    box-shadow: 0 10px 24px rgba(232, 165, 75, 0.28);
    letter-spacing: 0.01em;
}
.btn-join-group:hover { filter: brightness(1.05); }

.alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    background: rgba(232, 93, 76, 0.12);
    border: 1px solid rgba(232, 93, 76, 0.4);
    color: #ffc4bc;
}

.alert.is-hidden { display: none; }

.net-reconnect-banner {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.55;
    text-align: center;
    background: rgba(232, 165, 75, 0.16);
    border: 1px solid rgba(232, 165, 75, 0.45);
    color: #ffe1b0;
}
.net-reconnect-banner.is-hidden { display: none !important; }

.midgame-invite {
    margin: 14px 0 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.midgame-invite .hint { margin: 0 0 8px; }
.midgame-invite .code-panel { margin: 0; }

.otp-code-banner {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: center;
    background: rgba(61, 191, 138, 0.16);
    border: 1px solid rgba(61, 191, 138, 0.45);
    color: #d8ffe9;
}
.otp-code-banner-label,
.otp-code-banner-note {
    display: block;
    font-size: 0.82rem;
    color: #b7e8cc;
}
.otp-code-banner-label { margin-bottom: 6px; font-weight: 600; }
.otp-code-banner strong {
    display: block;
    font-size: 1.8rem;
    letter-spacing: 0.28em;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.otp-code-banner-note { margin-top: 8px; }

.auth-pin-input {
    letter-spacing: 0.35em;
    text-align: center;
    font-weight: 800;
    font-size: 1.15rem;
}

.auth-login-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 10px;
}

.auth-login-methods .btn {
    height: 44px;
    font-size: 0.92rem;
}

.auth-forgot-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.86rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.auth-forgot-link:hover {
    color: var(--text);
}

.auth-alt-actions {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.otp-help-box {
    margin: 14px 0 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(139, 124, 255, 0.1);
    border: 1px solid rgba(139, 124, 255, 0.32);
}

.otp-help-box h3 {
    margin: 0 0 8px;
    font-size: 0.92rem;
}

.otp-help-box p,
.otp-help-status {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.65;
}

.otp-help-box strong[dir="ltr"] {
    unicode-bidi: isolate;
    white-space: nowrap;
}

.otp-help-status.is-ok {
    color: #8ee0b8;
}

.otp-help-rules {
    margin: 0 0 10px;
    padding: 0 1.1em 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.7;
}

.otp-help-rules li {
    margin: 0 0 4px;
}

.otp-help-box .btn {
    margin-top: 4px;
}

.otp-help-preview {
    direction: ltr;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 8px;
    border-radius: 10px;
    background: var(--surface-deep);
    margin-bottom: 10px;
    color: var(--text);
}

.helper-otp-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(10, 7, 5, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.helper-otp-overlay.is-open { opacity: 1; }

.helper-otp-dialog {
    width: min(100%, 340px);
    padding: 22px 18px 16px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid rgba(139, 124, 255, 0.32);
    background:
        radial-gradient(ellipse 90% 70% at 50% -20%, rgba(139, 124, 255, 0.28), transparent 58%),
        linear-gradient(180deg, #2c2438 0%, #1c1624 48%, #141018 100%);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(220, 210, 255, 0.06) inset;
    transform: translateY(14px) scale(0.97);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.helper-otp-overlay.is-open .helper-otp-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.helper-otp-kicker {
    margin: 0 0 8px;
    font-weight: 800;
    font-size: 1.05rem;
}

.helper-otp-lead {
    margin: 0 0 14px;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.7;
}

.helper-otp-code {
    display: block;
    font-size: 2rem;
    letter-spacing: 0.28em;
    font-weight: 800;
    direction: ltr;
    unicode-bidi: isolate;
    margin: 0 0 16px;
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
}

.helper-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.avatar-grid button {
    height: 42px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--surface-deep);
    font-size: 1.2rem;
    cursor: pointer;
}

.avatar-grid button.is-on {
    border-color: var(--saffron);
    background: rgba(232, 165, 75, 0.15);
}

.avatar-picker-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.avatar-cats {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.avatar-cats::-webkit-scrollbar { display: none; }

.avatar-cat {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    padding: 6px 8px 5px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--surface-mid);
    color: var(--muted, #c9b9a0);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.avatar-cat-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.avatar-cat-label {
    font-size: 0.65rem;
    line-height: 1.2;
    white-space: nowrap;
}

.avatar-cat:hover {
    background: rgba(232, 165, 75, 0.12);
    transform: translateY(-1px);
}

.avatar-cat.is-on {
    border-color: rgba(232, 165, 75, 0.75);
    background: rgba(232, 165, 75, 0.18);
    color: var(--text, #fff3df);
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.18);
}

.welcome {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.welcome strong { color: var(--text); }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--surface-mid);
    border: 1px solid var(--line);
}

.card > #start-game {
    width: 100%;
    margin: 0 0 12px;
}

.toggle-row.is-clickable {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.toggle-row.is-clickable:active {
    background: var(--surface-strong);
}

.toggle-row.is-clickable:focus-visible {
    outline: 2px solid rgba(110, 214, 167, 0.55);
    outline-offset: 2px;
}

.toggle-row.is-clickable .switch {
    pointer-events: none;
}

/* هاله سبز/قرمز دور باکس «آماده‌ام» در لابی */
.ready-toggle {
    transition:
        border-color 0.65s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.65s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.65s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.ready-toggle > span {
    transition: color 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.ready-toggle .switch {
    transition: background 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.ready-toggle .switch::after {
    transition:
        right 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ready-toggle.is-waiting {
    border-color: rgba(232, 93, 76, 0.55);
    background: linear-gradient(160deg, rgba(232, 93, 76, 0.16), rgba(232, 93, 76, 0.05));
    box-shadow:
        0 0 0 3px rgba(232, 93, 76, 0.18),
        0 0 22px rgba(232, 93, 76, 0.28),
        inset 0 1px 0 rgba(255, 200, 190, 0.06);
}

.ready-toggle.is-waiting > span {
    color: #f0a398;
}

.ready-toggle.is-ready {
    border-color: rgba(94, 207, 154, 0.6);
    background: linear-gradient(160deg, rgba(94, 207, 154, 0.18), rgba(94, 207, 154, 0.05));
    box-shadow:
        0 0 0 3px rgba(94, 207, 154, 0.22),
        0 0 26px rgba(94, 207, 154, 0.35),
        inset 0 1px 0 rgba(200, 255, 230, 0.08);
}

.ready-toggle.is-ready > span {
    color: var(--mint);
}

.ready-toggle.is-clickable:active.is-waiting {
    background: linear-gradient(160deg, rgba(232, 93, 76, 0.22), rgba(232, 93, 76, 0.08));
}

.ready-toggle.is-clickable:active.is-ready {
    background: linear-gradient(160deg, rgba(94, 207, 154, 0.24), rgba(94, 207, 154, 0.08));
}

.mode-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 12px;
}

.mode-btn.is-system-mode {
    color: #7ad7cb;
    border-color: rgba(62, 207, 191, 0.42);
}
.mode-btn.is-system-mode.is-on {
    color: #042824;
    border-color: transparent;
    background: linear-gradient(135deg, #3ecfbf, #1a9a90);
    box-shadow: 0 8px 18px rgba(32, 168, 156, 0.28);
}
.mode-btn.is-self-mode {
    color: #c4b5fd;
    border-color: rgba(139, 124, 255, 0.42);
}
.mode-btn.is-self-mode.is-on {
    color: #f5f3ff;
    border-color: transparent;
    background: linear-gradient(135deg, #8b7cff, #5b4bd6);
    box-shadow: 0 8px 18px rgba(91, 75, 214, 0.3);
}

.rule-check-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.rule-sentence-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(232, 165, 75, 0.16);
    background: var(--surface-faint);
    color: #f0e2cf;
    font-size: 0.84rem;
}

.rule-sentence-label {
    display: block;
    width: 100%;
    color: #f0e2cf;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    transition: opacity 0.28s ease;
}

.rule-sentence-label.is-label-swap {
    opacity: 0.4;
}

.rule-sentence-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.rule-sentence-controls .rule-char-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 160px;
    margin: 0;
}

.rule-sentence-controls .mode-toggle-wrap {
    flex: 0 0 auto;
}

.rule-sentence-row .rule-char-select {
    margin: 0;
}

.rule-sentence-box {
    margin-bottom: 10px;
    padding: 10px 12px 8px;
    border-radius: 12px;
    border: 1px solid rgba(232, 165, 75, 0.16);
    background: var(--surface-faint);
}

.rule-sentence-box.is-coming-soon {
    opacity: 0.72;
    pointer-events: none;
    user-select: none;
    border-style: dashed !important;
    filter: grayscale(0.25);
}

.rule-sentence-box.is-coming-soon .rule-char-select,
.rule-sentence-box.is-coming-soon .soft-select-trigger {
    cursor: not-allowed;
    opacity: 0.78;
}

.coming-soon-badge {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-inset) 80%, var(--muted) 20%);
    vertical-align: middle;
}

.rule-sentence-box .rule-sentence-row {
    margin-bottom: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.state-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ccb69a;
    font-size: 0.72rem;
    white-space: nowrap;
}

.state-switch > span {
    opacity: 0.9;
}

.rule-state-select {
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 75, 0.32);
    background: linear-gradient(180deg, rgba(255, 233, 198, 0.14), rgba(26, 20, 16, 0.42));
    color: #fff1db;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    padding: 0 6px;
}

.rule-state-select:focus {
    outline: none;
    border-color: rgba(94, 207, 154, 0.62);
    box-shadow: 0 0 0 3px rgba(94, 207, 154, 0.15);
}

.rule-state-select.is-locked-mode,
.rule-state-select:disabled {
    border-color: rgba(185, 168, 148, 0.5);
    background: linear-gradient(180deg, rgba(185, 168, 148, 0.22), rgba(39, 31, 26, 0.5));
    color: #cfc2b1;
    cursor: not-allowed;
    opacity: 1;
}

.rule-state-select option {
    color: #1a1410;
    background: #fff7ec;
}

.rule-check-row label {
    font-size: 0.86rem;
    color: var(--text);
}

.rule-check-row.compact {
    grid-template-columns: 1fr 1fr;
}

.word-mode-wrap {
    margin-top: 6px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(232, 165, 75, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.word-mode-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.word-mode-hint,
.toggle-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    line-height: 1.5;
}

.toggle-block {
    margin-top: 4px;
}

.toggle-block .toggle-row {
    margin-bottom: 0;
}

.word-mode-label {
    display: block;
    font-size: 0.8rem;
    color: #d9c5ab;
    font-weight: 700;
    white-space: nowrap;
}

.mode-switch-plain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 75, 0.18);
    background: var(--surface-inset-soft);
    cursor: pointer;
}

.mode-switch-plain > span,
.mode-switch-plain .mode-switch-input {
    cursor: pointer;
}

.mode-switch-plain > span {
    font-size: 0.78rem;
    color: #f4e8d7;
}

.mode-switch-input {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #6a5849;
    background: linear-gradient(180deg, #514235, #3a2f27);
    position: relative;
    cursor: pointer;
    transition: all .22s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
    flex-shrink: 0;
}

.mode-switch-input::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff5e8;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
    transition: all .22s ease;
}

.mode-switch-input:checked {
    border-color: rgba(94, 207, 154, .82);
    background: linear-gradient(180deg, #67d9a4, #45b881);
    box-shadow: 0 0 14px rgba(94, 207, 154, .38), inset 0 0 0 1px rgba(255,255,255,.18);
}

.mode-switch-input:checked::before {
    right: 25px;
    background: #ffffff;
}

.mode-switch-input:focus-visible {
    outline: 2px solid rgba(94, 207, 154, 0.6);
    outline-offset: 2px;
}

.rule-lamp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 75, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.rule-lamp > span {
    font-size: 0.82rem;
    color: #f1e6d6;
}

.rule-lamp.mini {
    padding: 7px 9px;
}

.rule-lamp.mini > span {
    font-size: 0.76rem;
}

.lamp-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #5f4f43;
    background: linear-gradient(180deg, #4f4035, #3a2f27);
    position: relative;
    cursor: pointer;
    transition: all .22s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.lamp-switch::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f4e8d6;
    transition: all .22s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.lamp-switch:checked {
    border-color: rgba(94, 207, 154, 0.75);
    background: linear-gradient(180deg, rgba(94, 207, 154, 0.95), rgba(62, 175, 122, 0.95));
    box-shadow: 0 0 12px rgba(94, 207, 154, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.lamp-switch:checked::before {
    right: 23px;
    background: #ffffff;
}

.rule-panel {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(232, 165, 75, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(31, 24, 20, 0.82), rgba(26, 20, 16, 0.72));
}

.rule-panel-title {
    margin: 0 0 10px;
    color: #f2dfc6;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.rule-ui-mode {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}

.rule-ui-mode-btn {
    border: 1px solid rgba(232, 165, 75, 0.38);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 999px;
    padding: 7px 12px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.rule-ui-mode-btn.is-on {
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.28), rgba(94, 207, 154, 0.2));
    border-color: rgba(94, 207, 154, 0.55);
}

.rule-ui-mode-hint {
    width: 100%;
    margin: 2px 2px 0;
    font-size: 0.74rem;
}

.rule-panel .mode-toggle-wrap,
.rule-panel .rule-lock-hint,
.rule-panel [id$='-contains-box'],
.rule-panel [id$='-end-box'],
.rule-panel [id$='-start-box'],
.rule-panel [id$='-word-form-wrap'],
.rule-panel #c-word-length-wrap,
.rule-panel #r-word-length-wrap {
    opacity: 1;
    transform: translateY(0);
    max-height: 220px;
    overflow: hidden;
    transition:
        opacity 0.34s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        max-height 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.36s ease,
        padding 0.36s ease,
        border-width 0.36s ease;
}

.rule-panel .mode-toggle-wrap {
    max-width: 120px;
    transition:
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.34s ease;
}

.rule-panel.is-simple .rule-simple-hidden {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    pointer-events: none;
}

.rule-ui-feature-hidden {
    display: none !important;
}

.rule-panel.is-simple .rule-lock-hint {
    display: none !important;
}

/* در حالت پیشرفته منوی حروف نباید بریده شود */
.rule-panel.is-advanced [id$='-contains-box'],
.rule-panel:not(.is-simple) [id$='-contains-box'],
.rule-panel.is-advanced [id$='-end-box'],
.rule-panel:not(.is-simple) [id$='-end-box'],
.rule-panel.is-advanced [id$='-start-box'],
.rule-panel:not(.is-simple) [id$='-start-box'] {
    overflow: visible;
}

.rule-panel.is-simple #c-word-length-wrap:not(.rule-ui-feature-hidden),
.rule-panel.is-simple #r-word-length-wrap:not(.rule-ui-feature-hidden) {
    opacity: 1;
    transform: none;
    max-height: 220px;
    pointer-events: auto;
}

.rule-panel.is-simple #c-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden),
.rule-panel.is-simple #r-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden) {
    position: relative;
}

.rule-panel.is-simple #c-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden) input,
.rule-panel.is-simple #r-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden) input {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.78;
    background: var(--surface-inset);
    color: var(--muted);
}

.rule-panel.is-simple #c-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden)::after,
.rule-panel.is-simple #r-word-length-wrap.is-locked-simple:not(.rule-ui-feature-hidden)::after {
    content: 'در حالت ساده قابل تغییر نیست';
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.4;
}

.rule-panel.is-simple:not(.is-simple-modes) .mode-toggle-wrap {
    max-width: 0;
}

.rule-row {
    display: grid;
    grid-template-columns: 1fr 74px;
    gap: 8px;
    margin-bottom: 8px;
}

.rule-row select,
.rule-row input {
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 75, 0.18);
    background: var(--surface-inset);
    color: var(--text);
    padding: 0 10px;
}

.rule-row input {
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

.rule-char-select {
    text-align: center;
    text-align-last: center;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.03em;
    border-radius: 12px;
    border: 1px solid rgba(232, 165, 75, 0.45);
    background: linear-gradient(180deg, rgba(255, 233, 198, 0.18), rgba(31, 24, 20, 0.35));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff4e2;
    padding: 0 8px;
    min-height: 40px;
}

.rule-char-select:disabled {
    opacity: 0.55;
    filter: grayscale(0.25);
}

.rule-char-select.needs-letter {
    border-color: rgba(232, 120, 90, 0.72);
    box-shadow: 0 0 0 2px rgba(232, 120, 90, 0.18);
}

.rule-char-select.is-locked-all {
    border-color: rgba(185, 168, 148, 0.5);
    background: linear-gradient(180deg, rgba(185, 168, 148, 0.18), rgba(38, 32, 27, 0.45));
    color: #dfd3c4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rule-lock-hint {
    margin: 6px 2px 0;
    color: #b9a894;
    font-size: 0.74rem;
}

.rule-char-select:focus {
    outline: none;
    border-color: rgba(94, 207, 154, 0.65);
    box-shadow: 0 0 0 3px rgba(94, 207, 154, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.rule-char-select option {
    color: #1a1410;
    background: #fff7ec;
    font-weight: 700;
}

.rule-check-row input[type="text"],
.rule-check-row input[type="search"],
.rule-check-row input[type="tel"],
.rule-check-row input[type="number"],
.rule-check-row input:not([type]) {
    height: 40px;
}

/* ارتفاع واقعی محتوا (بدون سقف ثابت) تا دکمه‌های پایین روی فیلدها نیفتند */
#create-rule-box {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.38s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#create-rule-box > .create-rule-inner {
    overflow: hidden;
    min-height: 0;
}

#create-rule-box.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
}

#create-rule-box.is-open > .create-rule-inner {
    overflow: visible;
}

.create-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.switch {
    width: 48px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: #4a3d34;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: 0.18s ease;
}

.switch.is-on { background: var(--mint); }
.switch.is-on::after { right: 23px; }

/* —— lobby —— */
.lobby-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.timer {
    font-weight: 800;
    color: var(--saffron);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.code-panel {
    text-align: center;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(232, 165, 75, 0.08);
    border: 1px dashed rgba(232, 165, 75, 0.35);
}

.code-panel .code {
    font-family: "Vazirmatn FD", "Vazirmatn", ui-monospace, Consolas, monospace;
    font-size: clamp(1.35rem, 6vw, 1.85rem);
    font-weight: 800;
    letter-spacing: clamp(0.12em, 2.8vw, 0.28em);
    color: var(--saffron-hot);
    direction: ltr;
    word-break: break-all;
}

.code-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin: 10px auto 0;
}

.code-actions .btn {
    width: 100%;
    min-width: 0;
    height: 40px;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: nowrap;
}

.code-panel .btn:not(.code-actions .btn) {
    width: auto;
    min-width: 110px;
    height: 36px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

.seats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.seat {
    position: relative;
    text-align: center;
    padding: 8px 4px;
    border-radius: 14px;
    background: var(--surface-mid);
    border: 1px solid var(--line);
}

.seat.is-empty { opacity: 0.4; }
.seat.is-out { opacity: 0.3; filter: grayscale(0.8); }

.lobby-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 12px;
    min-height: 0;
}
.lobby-feed.is-empty {
    margin: 0;
}
.lobby-feed-item {
    padding: 10px 12px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text, #f0e8e0);
    background: var(--surface-mid);
    border: 1px solid var(--line);
    animation: lobby-feed-in 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.lobby-feed-item.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}
.lobby-feed-item.is-join {
    border-color: rgba(94, 207, 154, 0.24);
}
.lobby-feed-item.is-leave {
    border-color: rgba(196, 92, 92, 0.24);
    color: rgba(255, 255, 255, 0.78);
}
.lobby-feed-text {
    margin: 0;
    min-width: 0;
}
.lobby-feed-timer {
    margin-top: 8px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.lobby-feed-timer-bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: right center;
    background: linear-gradient(90deg, rgba(94, 207, 154, 0.85), rgba(140, 200, 255, 0.75));
    animation: lobby-feed-timer-shrink linear forwards;
}
.lobby-feed-item.is-leave .lobby-feed-timer-bar {
    background: linear-gradient(90deg, rgba(220, 110, 110, 0.85), rgba(180, 90, 90, 0.7));
}
@keyframes lobby-feed-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes lobby-feed-timer-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .lobby-feed-item,
    .lobby-feed-timer-bar {
        animation: none !important;
        transition: none !important;
    }
}

.seat-face {
    width: 44px;
    height: 44px;
    margin: 0 auto 4px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: linear-gradient(160deg, #3b2f27, #241c17);
    border: 1px solid var(--line);
}

.seat-name {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seat-ready {
    width: 9px;
    height: 9px;
    margin: 6px auto 0;
    border-radius: 50%;
    background: #5a4a3e;
}

.seat-ready.is-on {
    background: var(--mint);
    box-shadow: 0 0 10px rgba(94, 207, 154, 0.55);
}

.seat-host {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.58rem;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(232, 165, 75, 0.18);
    color: var(--saffron);
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 360px) {
    .seats { grid-template-columns: repeat(3, 1fr); }
    .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 520px) {
    .code-panel {
        padding: 14px 12px;
    }

    .code-actions {
        grid-template-columns: 1fr 1fr;
        max-width: none;
        gap: 10px;
    }

    .code-actions .btn {
        height: 44px;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    .code-actions #manual-refresh {
        grid-column: 1 / -1;
    }
}

@media (max-width: 360px) {
    .code-actions {
        grid-template-columns: 1fr;
    }

    .code-actions #manual-refresh {
        grid-column: auto;
    }

    .code-actions .btn {
        white-space: normal;
        text-align: center;
    }
}

.btn-sm {
    height: 36px;
    width: auto;
    min-width: 100px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.code-actions .btn.btn-sm {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 8px;
    font-size: 0.78rem;
}

@media (max-width: 520px) {
    .code-actions .btn.btn-sm {
        height: 44px;
        font-size: 0.8rem;
    }
}

.refresh-bar {
    display: none !important;
}

.seat-phone {
    font-size: 0.62rem;
    color: var(--muted);
    margin-top: 4px;
}

.dict-count-box {
    text-align: center;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(232, 165, 75, 0.1);
    border: 1px solid rgba(232, 165, 75, 0.25);
    font-size: 0.9rem;
}

.dict-count-box strong {
    font-size: 1.4rem;
    color: var(--saffron-hot);
}

.matched-words-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(232, 165, 75, 0.25);
    max-height: 160px;
    overflow-y: auto;
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #d9c5ab;
    word-break: break-word;
}

.matched-words-preview.is-empty {
    color: #c97a6a;
    font-style: italic;
}

.toggle-row.is-locked .hint {
    font-size: 0.72rem;
    color: var(--muted);
}

.switch.is-locked,
.switch:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    pointer-events: none;
}

.difficulty-box {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(232, 165, 75, 0.28);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.1), rgba(0, 0, 0, 0.18));
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.difficulty-box.is-easy {
    border-color: rgba(94, 207, 154, 0.4);
    box-shadow: 0 0 0 1px rgba(94, 207, 154, 0.08);
}

.difficulty-box.is-mid {
    border-color: rgba(232, 165, 75, 0.45);
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.1);
}

.difficulty-box.is-hard {
    border-color: rgba(232, 93, 76, 0.45);
    box-shadow: 0 0 0 1px rgba(232, 93, 76, 0.1);
}

.difficulty-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: #f0e2cf;
    font-size: 0.86rem;
}

.difficulty-value,
.difficulty-head strong {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--saffron-hot);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.difficulty-value.is-easy { color: #5ecf9a; }
.difficulty-value.is-mid { color: #f0b85f; }
.difficulty-value.is-hard { color: #ff8a7a; }

.difficulty-gauge {
    direction: rtl;
}

.difficulty-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 232, 200, 0.12);
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.difficulty-spectrum {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    /* راست = آسان (سبز) → چپ = سخت (قرمز) */
    background: linear-gradient(to left,
        #5ecf9a 0%,
        #8ee4bc 22%,
        #e8a54b 50%,
        #f0b85f 68%,
        #e85d4c 100%);
    opacity: 0.28;
    pointer-events: none;
}

.difficulty-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease;
    background: linear-gradient(to left, #3dbf88, #5ecf9a 55%, #8ee4bc);
    box-shadow: 0 0 12px rgba(94, 207, 154, 0.25);
    overflow: hidden;
}

.difficulty-fill.is-easy {
    background: linear-gradient(to left, #3dbf88, #5ecf9a 55%, #8ee4bc);
    box-shadow: 0 0 12px rgba(94, 207, 154, 0.3);
}

.difficulty-fill.is-mid {
    background: linear-gradient(to left, #5ecf9a, #e8a54b 55%, #f0b85f);
    box-shadow: 0 0 12px rgba(232, 165, 75, 0.28);
}

.difficulty-fill.is-hard {
    background: linear-gradient(to left, #5ecf9a, #e8a54b 40%, #e85d4c 78%, #ff6b5a);
    box-shadow: 0 0 14px rgba(232, 93, 76, 0.32);
}

.difficulty-marker {
    position: absolute;
    top: 50%;
    right: 0;
    left: auto;
    z-index: 2;
    width: 0;
    height: 0;
    transform: translate(50%, -50%);
    transition: right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.difficulty-marker.is-off {
    opacity: 0;
}

.difficulty-marker-stem {
    position: absolute;
    left: 50%;
    top: -16px;
    width: 2px;
    height: 12px;
    margin-left: -1px;
    border-radius: 2px;
    background: #fff3df;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.difficulty-marker-head {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid #fff3df;
    background: #5ecf9a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 243, 223, 0.12);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.difficulty-marker-head::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #fff3df;
}

.difficulty-marker.is-easy .difficulty-marker-head {
    background: #5ecf9a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(94, 207, 154, 0.45);
}

.difficulty-marker.is-mid .difficulty-marker-head {
    background: #e8a54b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(232, 165, 75, 0.45);
}

.difficulty-marker.is-hard .difficulty-marker-head {
    background: #e85d4c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(232, 93, 76, 0.5);
}

.difficulty-scale {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2px;
    margin-top: 10px;
    padding: 0 1px;
    font-size: 0.62rem;
    color: rgba(185, 168, 148, 0.7);
    font-weight: 600;
    direction: rtl;
    line-height: 1.25;
    text-align: center;
}

.difficulty-scale span {
    flex: 1 1 0;
    min-width: 0;
    transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
    opacity: 0.75;
}

.difficulty-scale span.is-on {
    opacity: 1;
    font-weight: 800;
    transform: translateY(-1px);
}

.difficulty-box.is-easy .difficulty-scale span.is-on { color: #5ecf9a; }
.difficulty-box.is-mid .difficulty-scale span.is-on { color: #f0b85f; }
.difficulty-box.is-hard .difficulty-scale span.is-on { color: #ff8a7a; }

@media (max-width: 400px) {
    .difficulty-scale {
        font-size: 0.56rem;
        gap: 1px;
    }
}

.dict-count-inline {
    margin-bottom: 10px;
    padding: 8px 10px;
    text-align: right;
    font-size: 0.82rem;
}

.difficulty-hint {
    margin: 8px 0 0;
    font-size: 0.74rem;
}

.picker-live {
    --picker-gold: var(--saffron, #e8a54b);
    --picker-mint: var(--mint, #5ecf9a);
    position: relative;
    margin: 14px 0 8px;
    padding: 18px 14px 16px;
    overflow: hidden;
    border: 1px solid rgba(232, 165, 75, 0.38);
    border-radius: 20px;
    background:
        radial-gradient(ellipse 80% 70% at 50% 0%, rgba(232, 165, 75, 0.22), transparent 58%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(94, 207, 154, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(18, 16, 22, 0.55), rgba(12, 10, 16, 0.35));
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.picker-live-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.picker-live-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 148px;
    margin: 4px 0 10px;
}

.picker-live-orbit {
    position: absolute;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 1.5px dashed rgba(232, 165, 75, 0.45);
    box-shadow: 0 0 24px rgba(232, 165, 75, 0.18);
    pointer-events: none;
}

.picker-live.is-spinning .picker-live-orbit {
    animation: picker-orbit 2.4s linear infinite;
}

.picker-live-glow {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 165, 75, 0.35), transparent 70%);
    filter: blur(4px);
    pointer-events: none;
}

.picker-live.is-spinning .picker-live-glow {
    animation: picker-glow 0.7s ease-in-out infinite;
}

.picker-live-avatar {
    position: relative;
    z-index: 1;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    line-height: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 42%),
        linear-gradient(165deg, rgba(40, 32, 24, 0.95), rgba(18, 16, 20, 0.98));
    border: 2px solid rgba(232, 165, 75, 0.55);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.28),
        0 0 0 6px rgba(232, 165, 75, 0.12);
}

.picker-live-avatar.is-flip {
    animation: picker-flip 0.18s ease;
}

.picker-live-avatar.is-final {
    border-color: rgba(94, 207, 154, 0.85);
    box-shadow:
        0 12px 28px rgba(94, 207, 154, 0.28),
        0 0 0 7px rgba(94, 207, 154, 0.16);
    animation: picker-win 0.55s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

.picker-live-name {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    font-size: 1.22rem;
    font-weight: 800;
    min-height: 1.4em;
    letter-spacing: 0.02em;
}

.picker-live-name.is-flip {
    animation: picker-name-swap 0.16s ease;
}

.picker-live-name.is-final {
    color: var(--picker-mint);
    text-shadow: 0 0 18px rgba(94, 207, 154, 0.35);
}

.picker-live-countdown {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--picker-gold);
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
    transition: transform 0.2s ease, color 0.2s ease;
}

.picker-live-countdown.is-done {
    color: var(--picker-mint);
    font-size: 1.8rem;
}

.picker-live-countdown-hint {
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.picker-live-roster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    opacity: 0.55;
    transform: scale(0.94);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.picker-chip.is-hot {
    opacity: 1;
    transform: scale(1.06);
    border-color: rgba(232, 165, 75, 0.7);
    background: rgba(232, 165, 75, 0.16);
    box-shadow: 0 0 16px rgba(232, 165, 75, 0.22);
}

.picker-live.is-done .picker-chip.is-hot {
    border-color: rgba(94, 207, 154, 0.7);
    background: rgba(94, 207, 154, 0.16);
    box-shadow: 0 0 16px rgba(94, 207, 154, 0.22);
}

.picker-chip-face {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.picker-chip-name {
    font-size: 0.72rem;
    font-weight: 700;
    max-width: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rule-maker-static {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.picker-static-face {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    border-radius: 50%;
    border: 2px solid rgba(94, 207, 154, 0.55);
    background: rgba(94, 207, 154, 0.08);
}

.btn-skip-rule {
    width: 100%;
    margin: 0 0 12px;
    border-color: rgba(232, 93, 76, 0.38) !important;
    color: #ffc2b8 !important;
}

@keyframes picker-orbit {
    to { transform: rotate(-360deg); }
}

@keyframes picker-glow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes picker-flip {
    0% { transform: scale(0.78) rotate(-8deg); opacity: 0.45; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes picker-name-swap {
    0% { transform: translateY(8px); opacity: 0.2; filter: blur(4px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

@keyframes picker-win {
    0% { transform: scale(0.72); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes pop-final {
    0% { transform: scale(0.88); opacity: 0.35; }
    100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .picker-live.is-spinning .picker-live-orbit,
    .picker-live.is-spinning .picker-live-glow,
    .picker-live-avatar.is-flip,
    .picker-live-avatar.is-final,
    .picker-live-name.is-flip,
    .play-heart,
    .play-card.is-critical,
    .timer.is-urgent {
        animation: none !important;
    }
}

.rule-summary {
    margin: 0 0 14px;
    padding-right: 18px;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── دکمه‌های باشد/نباشد ── */
.mode-toggle-wrap {
    display: inline-flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(232, 165, 75, 0.35);
    flex-shrink: 0;
    max-width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.35s ease;
}

.mode-toggle-wrap:not(.is-locked-mode) {
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.08);
}

.mode-toggle-wrap button {
    height: 36px;
    padding: 0 12px;
    border: 0;
    background: var(--surface-inset);
    color: #b9a894;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    min-width: 3.6em;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        min-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        border-width 0.3s ease;
}

.mode-toggle-wrap button.mode-btn-no {
    max-width: 5em;
    opacity: 1;
    transform: translateX(0);
    border-right: 1px solid rgba(232, 165, 75, 0.25);
    overflow: hidden;
}

.mode-toggle-wrap.is-locked-mode button.mode-btn-no {
    max-width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    border-right-width: 0;
}

.mode-toggle-wrap button.mode-btn-yes.is-active {
    background: rgba(94, 207, 154, 0.22);
    color: #5ecf9a;
}

.mode-toggle-wrap button.mode-btn-no.is-active {
    background: rgba(232, 165, 75, 0.18);
    color: #e8a54b;
}

.mode-toggle-wrap.is-locked-mode button.mode-btn-yes {
    background: rgba(94, 207, 154, 0.22);
    color: #5ecf9a;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .mode-toggle-wrap button,
    .rule-sentence-label,
    .rule-panel .mode-toggle-wrap,
    .rule-panel .rule-lock-hint,
    .rule-panel [id$='-contains-box'],
    .rule-panel [id$='-end-box'],
    .rule-panel [id$='-start-box'],
    .rule-panel [id$='-word-form-wrap'],
    .rule-panel #c-word-length-wrap,
    .rule-panel #r-word-length-wrap {
        transition: none !important;
    }
}

.is-hidden { display: none !important; }

.alert.is-hidden { display: none !important; }

.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    background: rgba(8, 5, 3, 0);
    overflow: hidden;
    transition: background 0.12s ease;
}

.profile-overlay.is-open {
    background: rgba(8, 5, 3, 0.82);
}

.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 9, 7, 0.72);
    backdrop-filter: blur(3px);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.guide-card {
    width: min(100%, 430px);
    max-height: min(88vh, 640px);
    overflow: auto;
    background: var(--card-face);
    border: 1px solid rgba(232, 165, 75, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    animation: slide-up-soft .25s ease;
}

.guide-body {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.guide-body p { margin: 0; }

/* —— پشتیبانی —— */
.support-overlay {
    position: fixed;
    inset: 0;
    z-index: 32;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(8, 5, 3, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
    overscroll-behavior: none;
    touch-action: none;
}
.support-overlay.is-open { opacity: 1; }
body.support-open {
    overflow: hidden;
    touch-action: none;
}
.support-sheet {
    width: min(100%, 460px);
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--card-face);
    border: 1px solid rgba(110, 168, 255, 0.28);
    border-radius: 18px 18px 14px 14px;
    box-shadow: var(--shadow);
    transform: translateY(18px);
    transition: transform 0.22s ease;
    overflow: hidden;
    touch-action: auto;
    overscroll-behavior: contain;
}
.support-overlay.is-open .support-sheet { transform: translateY(0); }
.support-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}
.support-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 8px;
}
.support-kicker {
    margin: 0 0 4px;
    font-size: 0.72rem;
    color: var(--muted);
}
.support-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}
.support-sub {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}
.support-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 4px 16px 12px;
    display: grid;
    gap: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.support-info {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--muted);
}
.support-info p { margin: 0 0 8px; }
.support-list {
    margin: 0 0 10px;
    padding: 0 16px 0 0;
}
.support-list li { margin-bottom: 6px; }
.support-note {
    font-size: 0.8rem;
    opacity: 0.9;
}
.biz-ads-hub.is-in-support {
    margin: 0;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.16);
}
.biz-ads-hub.is-in-support .biz-ads-hub-title {
    margin: 0 0 6px;
    font-size: 1rem;
}
.biz-ads-hub.is-in-support .btn {
    margin-top: 8px;
    width: 100%;
}
.biz-ads-login-hint {
    display: none;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(232, 165, 75, 0.28);
    background: rgba(232, 165, 75, 0.1);
    color: #f4e6d0;
    font-size: 0.82rem;
    line-height: 1.55;
}
.biz-ads-login-hint.is-on {
    display: block;
}
.biz-ads-login-actions {
    display: none;
    margin-top: 8px;
}
.biz-ads-login-actions.is-on {
    display: block;
}
.biz-ads-login-actions .btn {
    width: 100%;
}
.support-foot {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-body strong {
    color: var(--text);
    font-weight: 700;
}

/* —— پنل خلاصه قوانین بازیکن —— */
.rules-overlay {
    position: fixed;
    inset: 0;
    z-index: 82;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: var(--overlay-scrim);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rules-overlay.is-open { opacity: 1; }

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

.rules-sheet {
    width: 100%;
    max-width: 480px;
    height: min(92dvh, 780px);
    max-height: min(92dvh, 780px);
    display: flex;
    flex-direction: column;
    border-radius: 22px 22px 0 0;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(232, 165, 75, 0.12), transparent 55%),
        radial-gradient(90% 60% at 0% 100%, rgba(232, 120, 90, 0.08), transparent 50%),
        var(--sheet-face);
    border: 1px solid rgba(255, 243, 223, 0.14);
    border-bottom: none;
    box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.48);
    overflow: hidden;
    transform: translateY(22px);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.rules-overlay.is-open .rules-sheet { transform: translateY(0); }

.rules-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: rgba(255, 243, 223, 0.22);
    flex-shrink: 0;
}

.rules-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 16px 12px;
    border-bottom: 1px solid rgba(255, 243, 223, 0.08);
    flex-shrink: 0;
}

.rules-head-text { min-width: 0; }

.rules-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rules-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffe8df;
    background: rgba(232, 120, 90, 0.16);
    border: 1px solid rgba(232, 120, 90, 0.35);
}

.rules-head h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--heading-strong, #fff3df);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.rules-head-sub {
    margin: 6px 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--muted);
}

.rules-chip-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px 8px;
    flex-shrink: 0;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 243, 223, 0.06);
    -webkit-overflow-scrolling: touch;
}

.rules-chip-nav::-webkit-scrollbar { display: none; }

.rules-chip {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 243, 223, 0.12);
    background: rgba(255, 243, 223, 0.04);
    color: var(--muted);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.rules-chip:hover {
    border-color: rgba(232, 165, 75, 0.4);
    color: var(--text);
}

.rules-chip.is-on {
    border-color: rgba(232, 165, 75, 0.55);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.22), rgba(232, 165, 75, 0.08));
    color: #fff3df;
}

.rules-scroll {
    flex: 1 1 auto;
    overflow: auto;
    padding: 12px 16px 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.rules-note {
    margin: 0 0 14px;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(255, 243, 223, 0.04);
    border: 1px solid rgba(255, 243, 223, 0.1);
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.65;
}

.rules-empty {
    margin: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.rules-section {
    margin: 0 0 18px;
    padding: 0 0 4px;
}

.rules-section + .rules-section {
    border-top: 1px solid rgba(255, 243, 223, 0.07);
    padding-top: 16px;
}

.rules-section-head h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.rules-section-intro {
    margin: 0 0 12px;
    font-size: 0.76rem;
    line-height: 1.55;
    color: var(--muted);
}

.rules-rows {
    display: grid;
    gap: 8px;
}

.rules-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 243, 223, 0.045), rgba(255, 243, 223, 0.015));
    border: 1px solid rgba(255, 243, 223, 0.08);
}

.rules-row-text {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.rules-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.rules-hint {
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--muted);
}

.rules-value {
    justify-self: end;
    text-align: left;
    max-width: 46%;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
    color: #fff3df;
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.28), rgba(232, 165, 75, 0.12));
    border: 1px solid rgba(232, 165, 75, 0.35);
    white-space: normal;
    word-break: break-word;
}

.rules-example {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(94, 207, 154, 0.07);
    border: 1px solid rgba(94, 207, 154, 0.22);
}

.rules-example-mark {
    width: 6px;
    height: 6px;
    margin-top: 7px;
    border-radius: 50%;
    background: #5ecf9a;
    box-shadow: 0 0 0 4px rgba(94, 207, 154, 0.15);
    flex-shrink: 0;
}

.rules-example p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.6;
    color: #cfeede;
}

.rules-foot {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(255, 243, 223, 0.08);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
}

.rules-foot .btn {
    width: 100%;
}

@media (max-width: 640px) {
    .rules-sheet {
        height: min(94dvh, 100%);
        max-height: min(94dvh, 100%);
        border-radius: 18px 18px 0 0;
    }

    .rules-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rules-value {
        max-width: 100%;
        justify-self: stretch;
        text-align: center;
    }

    .rules-handle { display: none; }
}

.logout-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(10, 7, 5, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.logout-overlay.is-open { opacity: 1; }

.logout-dialog {
    width: min(100%, 340px);
    padding: 22px 18px 16px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid rgba(232, 93, 76, 0.28);
    background:
        radial-gradient(ellipse 90% 70% at 50% -20%, rgba(232, 93, 76, 0.28), transparent 58%),
        linear-gradient(180deg, #3a2824 0%, #241816 48%, #1a1210 100%);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 200, 180, 0.04) inset;
    transform: translateY(14px) scale(0.97);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.logout-overlay.is-open .logout-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.logout-icon {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(232, 93, 76, 0.28), rgba(232, 93, 76, 0.08));
    border: 1px solid rgba(255, 140, 120, 0.35);
    box-shadow: 0 10px 24px rgba(232, 93, 76, 0.18);
}

.logout-icon-door {
    position: absolute;
    top: 15px;
    right: 18px;
    width: 16px;
    height: 24px;
    border: 2px solid #ffc4b8;
    border-radius: 3px 4px 4px 3px;
    border-left-color: transparent;
}

.logout-icon-arrow {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 2px;
    background: #ffc4b8;
    transform: translateY(-50%);
    border-radius: 2px;
}

.logout-icon-arrow::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-left: 2px solid #ffc4b8;
    border-bottom: 2px solid #ffc4b8;
    transform: translateY(-50%) rotate(45deg);
}

.logout-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff3df;
    letter-spacing: -0.02em;
}

.logout-copy {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.7;
}

.logout-actions {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 8px;
}

.logout-actions .btn {
    height: 46px;
    font-size: 0.9rem;
}

.logout-actions .btn-coral {
    box-shadow: 0 10px 22px rgba(232, 93, 76, 0.28);
}

.profile-sheet {
    position: relative;
    width: min(100%, 480px);
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--profile-sheet-face);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.12s ease-out, opacity 0.1s ease;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 165, 75, 0.35) transparent;
}

.profile-overlay.is-open .profile-sheet {
    transform: translateY(0);
    opacity: 1;
}

.profile-handle {
    display: none;
}

.profile-hero {
    position: relative;
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 12px 14px 10px;
    gap: 2px;
    flex: 0 0 auto;
}

.profile-close {
    position: absolute;
    top: 10px;
    left: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 243, 223, 0.12);
    border-radius: 50%;
    background: var(--surface-inset);
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-close:hover {
    color: var(--text);
    border-color: rgba(232, 165, 75, 0.45);
    background: rgba(232, 165, 75, 0.12);
}

.profile-face-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 2px 0 6px;
    display: grid;
    place-items: center;
}

.profile-edit-btn {
    position: absolute;
    bottom: 0;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: #2a1a4a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: background 0.18s, transform 0.15s;
    z-index: 2;
}
.profile-edit-btn:hover {
    background: #3d1f6e;
    transform: scale(1.1);
}
.profile-edit-btn:active {
    transform: scale(0.95);
}

.profile-face-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(from 210deg, var(--saffron), var(--coral), var(--saffron-hot), var(--saffron));
    opacity: 0.9;
    animation: profile-ring 8s linear infinite;
}

.profile-face-ring::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--profile-ring-hole);
}

.profile-face {
    position: relative;
    z-index: 1;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--profile-face-bg);
    border: 1px solid rgba(255, 243, 223, 0.1);
    font-size: 2.55rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.profile-face.is-pop {
    animation: profile-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(232, 165, 75, 0.85);
    font-weight: 700;
}

.profile-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff3df;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-meta {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    margin-top: 8px;
}

.profile-coins {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    margin-top: 6px;
}

.coin-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 4px;
    border-radius: 10px;
    background: var(--surface-inset);
    border: 1px solid rgba(255, 243, 223, 0.1);
    font-size: 0.72rem;
}

.coin-chip strong {
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.coin-chip span:last-child {
    font-size: 0.68rem;
    color: var(--muted);
}

.coin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.coin-chip.is-bronze .coin-dot { background: linear-gradient(145deg, #d4a574, #8a5a2b); }
.coin-chip.is-silver .coin-dot { background: linear-gradient(145deg, #f2f4f7, #9aa3ad); }
.coin-chip.is-gold .coin-dot { background: linear-gradient(145deg, #ffe08a, #d4a017); }
.coin-chip.is-diamond .coin-dot { background: linear-gradient(145deg, #a8e7ff, #3bb6e8); }
.coin-chip.is-emerald .coin-dot { background: linear-gradient(145deg, #9ef0b8, #2fbf71); }
.coin-chip.is-ruby .coin-dot { background: linear-gradient(145deg, #ff9aa2, #e53935); }
.coin-chip.is-bronze strong { color: #e0b184; }
.coin-chip.is-silver strong { color: #dfe6ee; }
.coin-chip.is-gold strong { color: #ffd666; }
.coin-chip.is-diamond strong { color: #8fdfff; }
.coin-chip.is-emerald strong { color: #7dffb0; }
.coin-chip.is-ruby strong { color: #ff8a8a; }

.province-cup-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 16px 12px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 214, 102, 0.35);
    background: linear-gradient(135deg, rgba(80, 52, 12, 0.55), rgba(40, 24, 8, 0.72));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.province-cup-banner.is-in-profile {
    margin: 12px 0 0;
    width: 100%;
    box-sizing: border-box;
    text-align: right;
}
.province-cup-banner.is-city-cup {
    border-color: rgba(180, 200, 220, 0.35);
    background: linear-gradient(135deg, rgba(36, 48, 64, 0.62), rgba(20, 26, 36, 0.78));
}
.province-cup-banner.is-city-cup.is-gold .province-cup-copy strong { color: #ffe9a8; }
.province-cup-banner.is-city-cup.is-silver .province-cup-copy strong { color: #e8eef6; }
.province-cup-banner.is-city-cup.is-bronze .province-cup-copy strong { color: #f0c49a; }

.cup-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    vertical-align: middle;
}
.cup-mark-svg {
    display: block;
    width: 28px;
    height: 28px;
}
.cup-mark.is-gold { color: #f0c14b; }
.cup-mark.is-silver { color: #c5d0dc; }
.cup-mark.is-bronze { color: #d08a4c; }
.cup-mark.is-province .cup-mark-bowl {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.iran-cup-emblem {
    pointer-events: none;
}
.iran-cup-emblem {
    transform-box: fill-box;
    transform-origin: center;
}
.cup-mark.is-province .iran-cup-emblem {
    filter: drop-shadow(0 0.5px 0.5px rgba(0, 0, 0, 0.28));
}
.cup-mark.is-city .cup-mark-bowl {
    fill-opacity: 0.88;
}
.reward-pill.is-cup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.reward-pill.is-cup .cup-mark-svg {
    width: 18px;
    height: 18px;
}
.lb-geo-title-row .cup-mark {
    margin-inline-start: 4px;
}
.lb-geo-title-row .cup-mark-svg {
    width: 22px;
    height: 22px;
}
.province-cup-banner .cup-mark-svg {
    width: 36px;
    height: 36px;
}

/* —— تالار افتخارات (لانچر + پاپ‌آپ) —— */
.honor-launcher {
    width: 100%;
    max-width: none;
    margin: 16px 0 2px;
    text-align: center;
}
.honor-launcher-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(255, 236, 200, 0.72);
}
.honor-launcher-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
}
.honor-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 82px;
    padding: 10px 6px 9px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.honor-tile:hover,
.honor-tile:focus-visible {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    outline: none;
}
.honor-tile.is-earned {
    border-color: rgba(255, 214, 102, 0.32);
    background: rgba(255, 214, 102, 0.08);
    color: rgba(255, 244, 220, 0.98);
}
.honor-tile.is-earned.is-silver {
    border-color: rgba(190, 205, 220, 0.32);
    background: rgba(190, 205, 220, 0.08);
    color: rgba(240, 245, 250, 0.98);
}
.honor-tile.is-earned.is-bronze {
    border-color: rgba(196, 140, 90, 0.32);
    background: rgba(196, 140, 90, 0.08);
    color: rgba(255, 228, 200, 0.98);
}
.honor-tile.is-earned::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}
.honor-tile.is-idle {
    opacity: 0.88;
}
.honor-tile-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 34px;
    line-height: 0;
    flex-shrink: 0;
}
.honor-tile-icon .cup-mark-svg {
    width: 30px;
    height: 30px;
}
.honor-tile-icon .honor-medal.is-lg {
    font-size: 1.35rem;
}
.honor-tile-icon .honor-medal.is-sm {
    font-size: 1.1rem;
}
.honor-tile-icon .honor-crown,
.honor-tile-icon .crown-mark-svg {
    width: 30px;
    height: 30px;
}
.honor-tile-lock {
    font-size: 1rem;
    opacity: 0.35;
}
.honor-tile-name {
    display: -webkit-box;
    width: 100%;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-word;
}
.honor-tile-sub {
    display: block;
    width: 100%;
    margin-top: -2px;
    font-size: 0.62rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.72);
}

.collectibles-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}
.collectible-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
}
.collectible-pill strong {
    font-variant-numeric: tabular-nums;
}
.collectible-pill.is-diamond { border-color: rgba(120, 210, 255, 0.28); color: #8fdfff; }
.collectible-pill.is-emerald { border-color: rgba(80, 220, 130, 0.28); color: #7dffb0; }
.collectible-pill.is-ruby { border-color: rgba(255, 120, 120, 0.28); color: #ff8a8a; }
.collectible-pill.is-like { border-color: rgba(255, 255, 255, 0.14); }
.collectible-pill.is-flag { border-color: rgba(255, 120, 120, 0.22); color: #ff9b9b; }

.honor-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: end center;
    padding: 16px;
    background: rgba(6, 8, 14, 0.72);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.24s ease;
    overscroll-behavior: contain;
}
.honor-popup-overlay.is-open {
    opacity: 1;
}
body.honor-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    overscroll-behavior: none;
}
.honor-popup-sheet {
    width: min(440px, 100%);
    max-height: min(86vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 22px 22px 18px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(32, 36, 48, 0.98), rgba(14, 16, 22, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    transform: translateY(24px);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.honor-popup-overlay.is-open .honor-popup-sheet {
    transform: translateY(0);
}
.honor-popup-hero {
    position: relative;
    padding: 22px 20px 18px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(ellipse 80% 70% at 50% -20%, rgba(255, 214, 102, 0.18), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}
.honor-popup-sheet.is-earned.is-gold .honor-popup-hero {
    background:
        radial-gradient(ellipse 80% 70% at 50% -20%, rgba(255, 214, 102, 0.28), transparent 60%),
        linear-gradient(180deg, rgba(80, 52, 12, 0.35), transparent);
}
.honor-popup-sheet.is-earned.is-silver .honor-popup-hero {
    background:
        radial-gradient(ellipse 80% 70% at 50% -20%, rgba(190, 205, 220, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(48, 56, 68, 0.35), transparent);
}
.honor-popup-sheet.is-earned.is-bronze .honor-popup-hero {
    background:
        radial-gradient(ellipse 80% 70% at 50% -20%, rgba(196, 140, 90, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(72, 42, 22, 0.35), transparent);
}
.honor-popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.honor-popup-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
}
.honor-popup-icon {
    display: grid;
    place-items: center;
    height: 72px;
    margin-bottom: 8px;
}
.honor-popup-icon .cup-mark-svg {
    width: 52px;
    height: 52px;
}
.honor-popup-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}
.honor-popup-status {
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.68);
}
.honor-popup-rankline {
    margin: 6px 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffd166;
}
.honor-popup-chip {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
}
.honor-popup-chip.is-on {
    color: #ffe9a8;
    border-color: rgba(255, 214, 102, 0.42);
    background: rgba(255, 214, 102, 0.12);
}
.honor-popup-body {
    flex: 1;
    overflow: auto;
    padding: 16px 18px 8px;
    text-align: right;
}
.honor-popup-list-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
}
.honor-score-timeline {
    margin: 0 0 14px;
    padding: 10px 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}
.honor-score-timeline-head {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}
.honor-score-timeline-head strong {
    font-size: 0.68rem;
    color: rgba(255, 242, 222, 0.9);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.honor-score-timeline-head span {
    display: none;
}
.honor-score-rail-wrap {
    position: relative;
    height: 58px;
    margin: 0 2px;
}
.honor-score-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(208, 138, 76, 0.55), rgba(240, 193, 75, 0.92));
    box-shadow: 0 0 12px rgba(240, 193, 75, 0.22);
}
.honor-score-point {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
    min-width: 38px;
}
.honor-score-point.is-left {
    transform: translateX(0);
    text-align: right;
}
.honor-score-point.is-right {
    transform: translateX(-100%);
    text-align: left;
}
.honor-score-dot {
    position: absolute;
    left: 50%;
    top: 48px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #ffd36a;
    border: 2px solid rgba(44, 30, 10, 0.9);
    box-shadow: 0 0 0 2px rgba(255, 214, 102, 0.2), 0 0 10px rgba(255, 214, 102, 0.38);
}
.honor-score-point.is-me .honor-score-dot {
    background: #48d9ff;
    border-color: rgba(12, 38, 50, 0.95);
    box-shadow: 0 0 0 2px rgba(72, 217, 255, 0.28), 0 0 14px rgba(72, 217, 255, 0.52);
}
.honor-score-rank {
    display: none;
}
.honor-score-name {
    display: block;
    margin-top: 0;
    font-size: 0.57rem;
    font-weight: 700;
    color: rgba(255, 245, 230, 0.88);
    white-space: nowrap;
}
.honor-score-point.is-me .honor-score-name {
    color: #9ceeff;
    text-shadow: 0 0 10px rgba(72, 217, 255, 0.3);
}
.honor-score-timeline:not(.is-city) .honor-score-rail-wrap {
    height: 90px;
}
.honor-score-timeline:not(.is-city) .honor-score-rail {
    top: 78px;
}
.honor-score-timeline:not(.is-city) .honor-score-dot {
    top: 72px;
}
.honor-score-timeline:not(.is-city) .honor-score-name {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    display: block;
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: left top;
}
.honor-score-value {
    display: none;
}
.honor-score-edges {
    display: none;
}
.honor-score-timeline.is-city .honor-score-rail-wrap {
    height: 90px;
}
.honor-score-timeline.is-city .honor-score-rail {
    top: 78px;
}
.honor-score-timeline.is-city .honor-score-point {
    top: 0;
    min-width: 38px;
}
.honor-score-timeline.is-city .honor-score-dot {
    top: 72px;
}
.honor-score-point.is-vertical .honor-score-name {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    display: block;
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: left top;
}
.honor-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.honor-popup-row {
    display: grid;
    grid-template-columns: 28px 32px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}
.honor-popup-row.is-me {
    border-color: rgba(255, 214, 102, 0.35);
    background: rgba(255, 214, 102, 0.08);
}
.honor-popup-row.is-gold { border-color: rgba(255, 214, 102, 0.22); }
.honor-popup-row.is-silver { border-color: rgba(190, 205, 220, 0.2); }
.honor-popup-row.is-bronze { border-color: rgba(196, 140, 90, 0.2); }
.honor-popup-rank {
    font-size: 0.82rem;
    font-weight: 800;
    opacity: 0.75;
    text-align: center;
}
.honor-popup-mark {
    display: grid;
    place-items: center;
}
.honor-popup-name {
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.honor-popup-name em {
    font-style: normal;
    font-size: 0.65rem;
    color: #ffd166;
    margin-right: 4px;
}
.honor-popup-score {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.72;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.honor-popup-empty {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 16px 0;
}
.honor-popup-foot {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.honor-popup-dismiss {
    width: 100%;
}

@media (min-width: 560px) {
    .honor-popup-overlay {
        place-items: center;
    }
    .honor-popup-sheet {
        border-radius: 22px;
    }
}

/* —— افتخارات شخصی پروفایل (legacy) —— */
.personal-honors {
    margin: 0 0 18px;
    text-align: right;
}
.personal-honors-head {
    margin: 0 0 12px;
}
.personal-honors-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text, #f4efe6);
}
.personal-honors-sub {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.5;
}
.personal-honors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.honor-card {
    border-radius: 16px;
    padding: 12px 14px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}
.honor-card.is-earned {
    border-color: rgba(255, 214, 102, 0.35);
    background:
        linear-gradient(145deg, rgba(80, 52, 12, 0.35), rgba(20, 16, 10, 0.45));
}
.honor-card.is-earned.is-silver {
    border-color: rgba(190, 205, 220, 0.35);
    background: linear-gradient(145deg, rgba(48, 56, 68, 0.4), rgba(20, 24, 30, 0.5));
}
.honor-card.is-earned.is-bronze {
    border-color: rgba(196, 140, 90, 0.35);
    background: linear-gradient(145deg, rgba(72, 42, 22, 0.4), rgba(28, 16, 10, 0.5));
}
.honor-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.honor-card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.honor-card-icon .cup-mark-svg {
    width: 32px;
    height: 32px;
}
.honor-card-lock {
    font-size: 1.2rem;
    opacity: 0.35;
}
.honor-card-titles {
    flex: 1;
    min-width: 0;
}
.honor-card-scope {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}
.honor-card-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
}
.honor-chip {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
}
.honor-chip.is-on {
    color: #ffe9a8;
    border-color: rgba(255, 214, 102, 0.4);
    background: rgba(255, 214, 102, 0.12);
}
.honor-card-status {
    margin: 0 0 4px;
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}
.honor-card-rank {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd166;
}
.honor-empty {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}
.honor-top {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.honor-top-row {
    display: grid;
    grid-template-columns: 22px auto 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.78rem;
}
.honor-top-row.is-me {
    outline: 1px solid rgba(255, 214, 102, 0.35);
    background: rgba(255, 214, 102, 0.08);
}
.honor-top-rank {
    font-weight: 800;
    opacity: 0.75;
    text-align: center;
}
.honor-top-row .cup-mark-svg {
    width: 16px;
    height: 16px;
}
.honor-medal {
    font-size: 0.95rem;
    line-height: 1;
}
.honor-medal.is-lg {
    font-size: 1.45rem;
}
.honor-medal.is-sm {
    font-size: 0.82rem;
    opacity: 0.92;
}
.honor-crown {
    font-size: 1.35rem;
    line-height: 1;
}

/* —— تاج SVG (نفرات برتر کشور) —— */
.crown-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
}
.crown-mark-svg {
    width: 28px;
    height: 28px;
    display: block;
}
.crown-mark.is-gold {
    color: #ffd666;
    filter: drop-shadow(0 2px 4px rgba(255, 180, 40, 0.35));
}
.crown-mark.is-gold .crown-jewel {
    fill: #ff6b4a;
}
.crown-mark.is-silver {
    color: #dfe6ee;
    filter: drop-shadow(0 2px 4px rgba(180, 190, 200, 0.3));
}
.crown-mark.is-silver .crown-jewel {
    fill: #b8c4d4;
}
.crown-mark.is-bronze {
    color: #e0b184;
    filter: drop-shadow(0 2px 4px rgba(180, 120, 60, 0.3));
}
.crown-mark.is-bronze .crown-jewel {
    fill: #c98552;
}
.honor-popup-icon .crown-mark-svg {
    width: 54px;
    height: 54px;
}
.honor-popup-mark .crown-mark-svg {
    width: 26px;
    height: 26px;
}
.reward-pill .crown-mark-svg {
    width: 18px;
    height: 18px;
}

.honor-top-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.honor-top-name em {
    font-style: normal;
    font-size: 0.68rem;
    color: #ffd166;
    margin-right: 4px;
}
.honor-top-score {
    font-weight: 700;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 560px) {
    .personal-honors-grid {
        grid-template-columns: 1fr 1fr;
    }
    .personal-honors-grid .honor-card[data-honor="playerNational"] {
        grid-column: 1 / -1;
    }
}
.province-cup-banner.is-silver {
    border-color: rgba(190, 205, 220, 0.4);
    background: linear-gradient(135deg, rgba(48, 56, 68, 0.65), rgba(28, 32, 40, 0.78));
}
.province-cup-banner.is-bronze {
    border-color: rgba(196, 140, 90, 0.4);
    background: linear-gradient(135deg, rgba(72, 42, 22, 0.6), rgba(36, 20, 10, 0.78));
}
.province-cup-icon {
    font-size: 1.7rem;
    line-height: 1;
}
.province-cup-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}
.province-cup-copy strong {
    font-size: 0.95rem;
    color: #ffe9a8;
}
.province-cup-banner.is-silver .province-cup-copy strong { color: #e8eef6; }
.province-cup-banner.is-bronze .province-cup-copy strong { color: #f0c49a; }
.province-cup-copy span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
}

.rewards-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
    justify-content: center;
}
.reward-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f2e8d8;
}
.reward-pill.is-cup.is-gold,
.reward-pill.is-medal.is-gold { border-color: rgba(255, 214, 102, 0.45); color: #ffd666; }
.reward-pill.is-cup.is-silver,
.reward-pill.is-medal.is-silver { border-color: rgba(200, 210, 220, 0.45); color: #dfe6ee; }
.reward-pill.is-cup.is-bronze,
.reward-pill.is-medal.is-bronze { border-color: rgba(212, 165, 116, 0.45); color: #e0b184; }
.reward-pill.is-crown.is-gold { border-color: rgba(255, 214, 102, 0.55); color: #ffd666; }
.reward-pill.is-crown.is-silver { border-color: rgba(200, 210, 220, 0.45); color: #dfe6ee; }
.reward-pill.is-crown.is-bronze { border-color: rgba(212, 165, 116, 0.45); color: #e0b184; }
.reward-pill.is-emerald { border-color: rgba(80, 220, 130, 0.35); color: #7dffb0; }
.reward-pill.is-ruby { border-color: rgba(255, 120, 120, 0.35); color: #ff8a8a; }
.reward-pill.is-flag { border-color: rgba(255, 120, 120, 0.28); color: #ff9b9b; }
.reward-pill.is-medal.is-large { font-size: 0.95rem; }
.reward-pill.is-medal.is-small { font-size: 0.78rem; opacity: 0.92; }
.lb-medal {
    margin-inline-start: 6px;
    font-size: 0.95rem;
}
.lb-coin.is-diamond {
    color: #8fdfff;
}

.lb-coins {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-top: 0;
}

.lb-coin {
    min-width: 22px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.lb-coin.is-bronze { background: rgba(184, 115, 51, 0.22); color: #e0b184; }
.lb-coin.is-silver { background: rgba(180, 190, 200, 0.2); color: #dfe6ee; }
.lb-coin.is-gold { background: rgba(212, 160, 23, 0.22); color: #ffd666; }

.play-mode-block {
    margin: 12px 0 14px;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-mid);
    border: 1px solid rgba(255, 243, 223, 0.1);
}

.play-mode-title {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.play-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 243, 223, 0.1);
    background: rgba(255, 243, 223, 0.03);
    cursor: pointer;
    transition:
        border-color 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.2s ease;
}

.play-mode-option:last-of-type { margin-bottom: 0; }

.extra-words-block {
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(61, 191, 138, 0.28);
    background: rgba(61, 191, 138, 0.08);
}

.extra-words-block.is-hidden {
    display: none !important;
}

.extra-words-block.is-timed-forced .toggle-row.is-locked {
    opacity: 0.72;
    cursor: default;
}

.extra-words-cap-field {
    margin-top: 4px;
    margin-bottom: 8px;
}

.extra-words-cap-field input {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-inset);
    color: var(--text);
    padding: 0 12px;
    font: inherit;
}

.extra-words-cap-field input:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.65);
}

.play-mode-option:active {
    transform: scale(0.99);
}

.play-mode-preview {
    margin-top: 14px;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 243, 223, 0.12);
    background:
        linear-gradient(165deg, rgba(255, 243, 223, 0.055) 0%, transparent 42%),
        linear-gradient(180deg, rgba(20, 15, 12, 0.92), rgba(12, 9, 7, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 243, 223, 0.06),
        0 10px 28px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        border-color 0.28s ease;
}

.play-mode-preview.is-switching {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

.play-mode-preview.is-ready {
    opacity: 1;
    transform: translateY(0);
}

.pm-brief-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(255, 243, 223, 0.08);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.08), transparent);
}

.pm-brief-kicker {
    margin: 0 0 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(232, 165, 75, 0.92);
    text-transform: none;
}

.pm-brief-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: #f6efe6;
    line-height: 1.35;
}

.pm-brief-badge {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 58px;
    padding: 9px 12px 8px;
    border-radius: 10px;
    text-align: center;
    background: linear-gradient(160deg, rgba(255, 243, 223, 0.06), rgba(0, 0, 0, 0.28));
    border: 1px solid rgba(255, 243, 223, 0.14);
    box-shadow: none;
    position: relative;
}

.pm-brief-badge::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 7px;
    border: 1px solid rgba(232, 165, 75, 0.18);
    pointer-events: none;
}

.pm-brief-badge-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    color: #e8d5b5;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.pm-brief-badge-unit {
    display: block;
    margin-top: 1px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(168, 153, 140, 0.95);
}

.pm-brief-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255, 243, 223, 0.06);
}

.pm-brief-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 13px 13px;
    background: rgba(14, 11, 9, 0.92);
    min-width: 0;
}

.pm-brief-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #a8998c;
    letter-spacing: 0.01em;
}

.pm-brief-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f6efe6;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.pm-brief-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(168, 153, 140, 0.92);
    line-height: 1.45;
}

.pm-brief.is-timed .pm-brief-head {
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.1), transparent);
}

.pm-brief.is-quota .pm-brief-head {
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.07), transparent);
}

/* سازگاری کلاس‌های قدیمی اگر جایی مانده */
.play-mode-preview-title,
.play-mode-preview-list {
    display: none;
}

@media (max-width: 380px) {
    .pm-brief-grid {
        grid-template-columns: 1fr;
    }

    .pm-brief-title {
        font-size: 0.86rem;
    }
}

.play-mode-option:has(input:checked) {
    border-color: rgba(232, 165, 75, 0.55);
    background: rgba(232, 165, 75, 0.1);
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.08);
}

.play-mode-option input {
    margin-top: 3px;
    accent-color: var(--saffron);
}

.play-mode-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.play-mode-body strong {
    font-size: 0.86rem;
    color: var(--text);
}

.play-mode-body span {
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--muted);
}

.timer.is-off {
    opacity: 0.75;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.timer.is-urgent {
    color: #ff8a7a;
    animation: timer-pulse 1s ease-in-out infinite;
}

.play-timer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.play-heart {
    display: inline-flex;
    color: #ff6b5a;
    font-size: 0.95rem;
    line-height: 1;
    animation: heart-beat var(--beat, 1.05s) ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 80, 70, 0.55));
}

.play-heart.is-calm {
    color: #ff8a7a;
    opacity: 0.72;
}

.play-card.is-tense {
    box-shadow:
        0 18px 44px rgba(232, 93, 76, 0.16),
        0 0 0 1px rgba(232, 93, 76, 0.18) inset;
}

.play-card.is-critical {
    animation: play-critical-glow 0.85s ease-in-out infinite;
}

body.is-play-critical {
    background-image: radial-gradient(ellipse 90% 70% at 50% 100%, rgba(180, 30, 40, 0.18), transparent 55%);
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.22); }
    28% { transform: scale(1); }
    42% { transform: scale(1.14); }
    56% { transform: scale(1); }
}

@keyframes play-critical-glow {
    0%, 100% { box-shadow: 0 16px 36px rgba(232, 93, 76, 0.16), 0 0 0 1px rgba(232, 93, 76, 0.2) inset; }
    50% { box-shadow: 0 18px 48px rgba(255, 70, 60, 0.32), 0 0 0 1px rgba(255, 90, 80, 0.45) inset; }
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

.btn-add-word {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 14px;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.btn-add-word.is-hidden { display: none !important; }

.play-finish-box {
    margin: 12px 0 4px;
    padding: 12px 12px 10px;
    border-radius: 16px;
    border: 1px solid transparent;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.play-finish-box.is-waiting {
    border-color: rgba(232, 93, 76, 0.55);
    background: linear-gradient(160deg, rgba(232, 93, 76, 0.16), rgba(232, 93, 76, 0.05));
    box-shadow:
        0 0 0 3px rgba(232, 93, 76, 0.18),
        0 0 22px rgba(232, 93, 76, 0.28),
        inset 0 1px 0 rgba(255, 200, 190, 0.06);
}

.play-finish-box.is-ready {
    border-color: rgba(94, 207, 154, 0.6);
    background: linear-gradient(160deg, rgba(94, 207, 154, 0.18), rgba(94, 207, 154, 0.05));
    box-shadow:
        0 0 0 3px rgba(94, 207, 154, 0.22),
        0 0 26px rgba(94, 207, 154, 0.35),
        inset 0 1px 0 rgba(200, 255, 230, 0.08);
}

.play-finish-box #finish-hint {
    margin: 0 0 10px;
}

.play-finish-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    flex-wrap: wrap;
}

.play-finish-actions #finish-writing {
    flex: 1 1 auto;
    min-width: min(100%, 160px);
    max-width: 280px;
}

.profile-stat {
    padding: 10px 8px;
    border-radius: 14px;
    background: var(--surface-inset);
    border: 1px solid rgba(255, 243, 223, 0.1);
    text-align: center;
}

.profile-stat-val {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--saffron-hot);
    font-variant-numeric: tabular-nums;
}

.profile-stat-label {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    color: var(--muted);
}

.leaderboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: var(--overlay-scrim);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.leaderboard-overlay.is-open { opacity: 1; }

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

body.profile-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    overscroll-behavior: none;
}

.leaderboard-sheet {
    width: 100%;
    max-width: 480px;
    height: min(94dvh, 820px);
    max-height: min(94dvh, 820px);
    display: flex;
    flex-direction: column;
    border-radius: 22px 22px 0 0;
    background: var(--sheet-face);
    border: 1px solid rgba(255, 243, 223, 0.12);
    border-bottom: none;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transform: translateY(18px);
    transition: transform 0.22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.leaderboard-overlay.is-open .leaderboard-sheet { transform: translateY(0); }

.lb-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: rgba(255, 243, 223, 0.22);
    flex-shrink: 0;
}

.leaderboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(255, 243, 223, 0.08);
    flex-shrink: 0;
}

.lb-head-text {
    min-width: 0;
}

.leaderboard-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--heading-strong);
}

.lb-head-sub {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}

.lb-city-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 14px 8px;
    margin: 0;
    max-height: 64px;
    opacity: 1;
    transform: translateY(0);
    border-bottom: 1px solid rgba(255, 243, 223, 0.08);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    transition:
        max-height 0.32s ease,
        opacity 0.28s ease,
        transform 0.28s ease,
        padding 0.28s ease,
        border-color 0.28s ease;
}

.lb-city-bar::-webkit-scrollbar { display: none; }
.lb-city-bar.is-hidden { display: none; }
.lb-city-bar.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
    pointer-events: none;
}

.lb-city-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 243, 223, 0.14);
    background: var(--surface-inset);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition:
        border-color 0.28s ease,
        background 0.28s ease,
        color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.2s ease;
}

.lb-city-chip:active {
    transform: scale(0.97);
}

.lb-city-chip.is-on {
    color: #fff3df;
    border-color: rgba(232, 165, 75, 0.55);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.28), rgba(232, 165, 75, 0.1));
    box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.12), 0 4px 12px rgba(232, 165, 75, 0.18);
}

.lb-city-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 243, 223, 0.12);
    color: #fff3df;
    font-size: 0.68rem;
    line-height: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: background 0.28s ease, color 0.28s ease;
}

.lb-city-chip.is-on .lb-city-count {
    background: rgba(255, 243, 223, 0.2);
}

.lb-scope-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 8px 14px 0;
    padding: 4px;
    border-radius: 14px;
    background: var(--surface-faint);
    border: 1px solid rgba(255, 243, 223, 0.07);
    flex-shrink: 0;
}

.lb-scope-tab {
    appearance: none;
    border: none;
    border-radius: 11px;
    min-height: 34px;
    padding: 0 8px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.lb-scope-tab:active {
    transform: scale(0.98);
}

.lb-scope-tab.is-on {
    color: #1a1208;
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.95), rgba(201, 132, 46, 0.95));
    box-shadow: 0 3px 10px rgba(232, 165, 75, 0.22);
}

.lb-view-tabs,
.lb-view-tab {
    display: none !important;
}

.lb-panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.lb-panel {
    grid-area: 1 / 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.985);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0.3s;
}

.lb-panel.is-on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0s;
    z-index: 1;
}

.lb-panel.is-instant {
    transition: none !important;
}

.lb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 4px;
    align-items: center;
}

.lb-size-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 8px;
}

.lb-size-max {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(232, 165, 75, 0.12);
    border: 1px solid rgba(232, 165, 75, 0.22);
    min-width: 72px;
}

.lb-size-max-label {
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.2;
}

.lb-size-max-value {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--saffron-hot, #e8a54b);
    font-variant-numeric: tabular-nums;
}

.lb-size-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lb-size-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 243, 223, 0.12);
    font-variant-numeric: tabular-nums;
}

.lb-city {
    font-size: 0.72rem;
    color: var(--saffron-hot);
    font-weight: 600;
}

.leaderboard-list {
    overflow: auto;
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.leaderboard-list.is-fading {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

.leaderboard-list.is-geo-tree {
    gap: 0;
}

.lb-geo-intro {
    margin: 0 0 12px;
    padding: 0 2px;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #a8998c;
}

.lb-geo-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-geo-node {
    border-radius: 16px;
    background: var(--surface-mid);
    border: 1px solid rgba(255, 243, 223, 0.1);
    overflow: hidden;
}

.lb-geo-node.is-gold {
    border-color: rgba(255, 214, 102, 0.28);
    background: linear-gradient(160deg, rgba(255, 214, 102, 0.1), rgba(0, 0, 0, 0.22));
}

.lb-geo-node.is-silver {
    border-color: rgba(223, 230, 238, 0.22);
    background: linear-gradient(160deg, rgba(223, 230, 238, 0.08), rgba(0, 0, 0, 0.22));
}

.lb-geo-node.is-bronze {
    border-color: rgba(224, 177, 132, 0.22);
    background: linear-gradient(160deg, rgba(224, 177, 132, 0.08), rgba(0, 0, 0, 0.22));
}

.lb-geo-province {
    width: 100%;
    display: grid;
    grid-template-columns: 18px 34px minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 12px;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: right;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.lb-geo-province:hover {
    background: rgba(255, 243, 223, 0.04);
}

.lb-geo-province:focus-visible {
    outline: 2px solid rgba(232, 165, 75, 0.55);
    outline-offset: -2px;
}

.lb-geo-chevron {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(255, 243, 223, 0.06);
    border: 1px solid rgba(255, 243, 223, 0.12);
    position: relative;
    transition: transform 0.28s ease, background 0.28s ease;
}

.lb-geo-chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #e8a54b;
    border-bottom: 1.5px solid #e8a54b;
    transform: translate(-60%, -70%) rotate(45deg);
}

.lb-geo-node.is-open > .lb-geo-province .lb-geo-chevron {
    background: rgba(232, 165, 75, 0.16);
    transform: rotate(180deg);
}

.lb-geo-body {
    min-width: 0;
}

.lb-geo-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lb-geo-badge {
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 3px 7px;
    border-radius: 999px;
    line-height: 1.2;
}

.lb-geo-badge.is-province {
    color: #1a1410;
    background: linear-gradient(135deg, #f0c27a, #e8a54b);
}

.lb-geo-badge.is-city {
    color: #f6efe6;
    background: rgba(246, 239, 230, 0.1);
    border: 1px solid rgba(246, 239, 230, 0.14);
}

.lb-geo-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f6efe6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-geo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #a8998c;
}

.lb-geo-cities-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s ease;
}

.lb-geo-node.is-open > .lb-geo-cities-wrap {
    grid-template-rows: 1fr;
}

.lb-geo-cities {
    list-style: none;
    margin: 0;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.28s ease, transform 0.28s ease, padding 0.28s ease;
    border-top: 1px solid transparent;
    background: var(--surface-faint);
}

.lb-geo-node.is-open > .lb-geo-cities-wrap > .lb-geo-cities {
    opacity: 1;
    transform: translateY(0);
    padding: 8px 12px 10px;
    border-top-color: rgba(255, 243, 223, 0.06);
}

.lb-geo-city {
    position: relative;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    padding-right: 6px;
}

.lb-geo-branch {
    position: relative;
    width: 14px;
}

.lb-geo-branch::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: -6px;
    right: 6px;
    width: 1px;
    background: rgba(232, 165, 75, 0.28);
}

.lb-geo-branch::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 6px;
    width: 8px;
    height: 1px;
    background: rgba(232, 165, 75, 0.28);
}

.lb-geo-city.is-last .lb-geo-branch::before {
    bottom: 50%;
}

.lb-geo-city-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 243, 223, 0.03);
    border: 1px solid rgba(255, 243, 223, 0.08);
}

.lb-geo-city.is-gold .lb-geo-city-card {
    border-color: rgba(255, 214, 102, 0.22);
    background: rgba(255, 214, 102, 0.06);
}

.lb-geo-empty {
    margin: 0;
    padding: 10px 8px 4px;
    font-size: 0.78rem;
    color: #a8998c;
    list-style: none;
}

.leaderboard-sheet .iran-map-card {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    max-height: none;
}

.leaderboard-sheet .iran-map-title {
    font-size: 0.95rem;
}

.leaderboard-sheet .iran-map-hint {
    display: none;
}

.leaderboard-sheet .iran-map-svg-wrap {
    max-width: min(100%, 340px);
}

.leaderboard-sheet .iran-map-legend {
    margin-top: 10px;
    gap: 8px 12px;
}

.lb-row {
    display: grid;
    grid-template-columns: 34px 40px minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 16px;
    background: var(--surface-mid);
    border: 1px solid rgba(255, 243, 223, 0.1);
}

.lb-row.is-me {
    border-color: rgba(94, 207, 154, 0.5);
    background: rgba(94, 207, 154, 0.1);
    box-shadow: inset 0 0 0 1px rgba(94, 207, 154, 0.12);
}

.lb-row.is-gold {
    background: linear-gradient(120deg, rgba(255, 214, 102, 0.12), rgba(0, 0, 0, 0.18));
    border-color: rgba(255, 214, 102, 0.28);
}

.lb-row.is-silver {
    background: linear-gradient(120deg, rgba(223, 230, 238, 0.1), rgba(0, 0, 0, 0.18));
    border-color: rgba(223, 230, 238, 0.22);
}

.lb-row.is-bronze {
    background: linear-gradient(120deg, rgba(224, 177, 132, 0.1), rgba(0, 0, 0, 0.18));
    border-color: rgba(224, 177, 132, 0.22);
}

.lb-rank {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--saffron-hot);
    background: rgba(232, 165, 75, 0.12);
    font-variant-numeric: tabular-nums;
}

.lb-rank.is-gold {
    color: #1a1208;
    background: linear-gradient(145deg, #ffe08a, #d4a017);
}

.lb-rank.is-silver {
    color: #1a1208;
    background: linear-gradient(145deg, #f2f4f7, #9aa3ad);
}

.lb-rank.is-bronze {
    color: #1a1208;
    background: linear-gradient(145deg, #e0b184, #8a5a2b);
}

.lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: rgba(255, 243, 223, 0.08);
    border: 1px solid rgba(255, 243, 223, 0.1);
}

.lb-main {
    min-width: 0;
}

.lb-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #fff3df;
    min-width: 0;
}

.lb-nick {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.lb-you {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--mint);
    color: #0d2a1c;
    font-size: 0.68rem;
    font-weight: 800;
}

.lb-phone {
    display: none;
}

.lb-score-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-width: 52px;
}

.lb-score {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--saffron-hot);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.lb-score-label {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 600;
}

@media (min-width: 640px) {
    .leaderboard-overlay {
        align-items: center;
        padding: 16px;
    }

    .leaderboard-sheet {
        border-radius: 22px;
        border-bottom: 1px solid rgba(255, 243, 223, 0.12);
        height: min(88vh, 760px);
        max-height: min(88vh, 760px);
    }

    .lb-handle { display: none; }
}

@media (max-width: 380px) {
    .lb-row {
        grid-template-columns: 30px 34px minmax(0, 1fr) auto;
        gap: 6px 8px;
        padding: 10px;
    }

    .lb-rank {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 0.8rem;
    }

    .lb-avatar {
        width: 34px;
        height: 34px;
        font-size: 1.15rem;
        border-radius: 12px;
    }

    .lb-nick { font-size: 0.86rem; }
    .lb-score { font-size: 0.95rem; }

    .lb-geo-province {
        grid-template-columns: 16px 28px minmax(0, 1fr) auto;
        gap: 6px 8px;
        padding: 10px;
    }

    .lb-geo-city-card {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        padding: 8px 9px;
    }

    .lb-geo-name { font-size: 0.86rem; }
}

.profile-body {
    flex: 0 0 auto;
    overflow: visible;
    padding: 4px 16px 8px;
    display: grid;
    gap: 8px;
}

.profile-block {
    display: grid;
    gap: 8px;
}

.profile-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.profile-prefs .btn-calendar,
.profile-prefs .btn-leaderboard,
.profile-prefs .sfx-toggle-fab,
.profile-prefs .btn-theme,
.profile-prefs .btn-insects {
    height: 42px;
    padding: 0 14px;
    font-size: 0.82rem;
}

.btn-dict {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(232, 165, 75, 0.4);
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.18), rgba(232, 165, 75, 0.06));
    color: #fff3df;
    font: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(232, 165, 75, 0.14);
    white-space: nowrap;
}

.btn-dict:hover {
    border-color: rgba(232, 165, 75, 0.75);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 165, 75, 0.26);
    color: #fff3df;
}

.profile-label,
.profile-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.profile-label-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(185, 168, 148, 0.7);
}

.profile-input {
    width: 100%;
    height: 50px;
    border-radius: 14px;
    border: 1px solid rgba(255, 243, 223, 0.12);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 16px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-input:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.7);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.15);
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 243, 223, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 243, 223, 0.04), transparent 40%),
        rgba(0, 0, 0, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 165, 75, 0.35) transparent;
}

.avatar-pick {
    aspect-ratio: 1;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 243, 223, 0.04);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.avatar-pick:hover {
    background: rgba(232, 165, 75, 0.12);
    transform: translateY(-1px);
}

.avatar-pick.is-on {
    border-color: rgba(232, 165, 75, 0.85);
    background: rgba(232, 165, 75, 0.18);
    box-shadow: 0 0 0 2px rgba(232, 165, 75, 0.2), 0 6px 16px rgba(232, 165, 75, 0.18);
    transform: scale(1.04);
}

.profile-geo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-geo .field { margin-bottom: 0; }

.profile-sheet .avatar-picker {
    max-height: none;
}

.profile-foot {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 12px 16px calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(255, 243, 223, 0.08);
    background:
        linear-gradient(180deg, rgba(26, 20, 16, 0.92), rgba(26, 20, 16, 0.98) 35%, #1a1410);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ─── Edit Panel (mobile bottom sheet) ─── */
.profile-edit-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}
.profile-edit-panel.is-open {
    display: flex;
    pointer-events: auto;
}
.profile-edit-scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(6, 4, 3, 0.62);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.profile-edit-panel.is-open .profile-edit-scrim {
    opacity: 1;
}
.profile-edit-panel-inner {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: min(92dvh, 760px);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(232, 165, 75, 0.18), transparent 55%),
        linear-gradient(180deg, #2c221c 0%, #1a1410 48%, #14100d 100%);
    border-radius: 22px 22px 0 0;
    border: 1px solid rgba(255, 243, 223, 0.1);
    border-bottom: none;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.profile-edit-panel.is-open .profile-edit-panel-inner {
    transform: translateY(0);
}
.profile-edit-handle {
    width: 40px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: rgba(255, 243, 223, 0.22);
    flex: 0 0 auto;
}
.profile-edit-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px 12px;
    flex: 0 0 auto;
}
.profile-edit-head-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.profile-edit-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(232, 165, 75, 0.85);
}
.profile-edit-head-copy strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff3df;
}
.profile-edit-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 243, 223, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: rgba(255, 243, 223, 0.7);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.profile-edit-close:hover,
.profile-edit-close:active {
    color: #fff;
    border-color: rgba(232, 165, 75, 0.45);
    background: rgba(232, 165, 75, 0.12);
}
.profile-edit-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 14px 12px;
    display: grid;
    gap: 12px;
    align-content: start;
}
.profile-edit-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(232, 165, 75, 0.14), transparent 55%),
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 243, 223, 0.08);
}
.profile-edit-preview-face {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: var(--profile-face-bg);
    border: 2px solid rgba(232, 165, 75, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}
.profile-edit-preview-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.profile-edit-preview-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff3df;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-edit-preview-phone {
    font-size: 0.82rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: right;
}
.profile-edit-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 243, 223, 0.07);
}
.profile-edit-card .profile-label,
.profile-edit-card .profile-label-row {
    margin: 0;
}
.profile-edit-card .avatar-picker {
    max-height: 168px;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 10px;
}
.profile-edit-card .avatar-pick {
    min-height: 48px;
    font-size: 1.35rem;
    border-radius: 14px;
}
.profile-edit-card .profile-geo {
    grid-template-columns: 1fr;
    gap: 10px;
}
.profile-edit-card .field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.profile-edit-card select {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 243, 223, 0.12);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(232, 165, 75, 0.9) 50%),
        linear-gradient(135deg, rgba(232, 165, 75, 0.9) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
.profile-edit-card select:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.7);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.15);
}
.profile-edit-foot {
    display: grid;
    grid-template-columns: 1fr 1.45fr;
    gap: 10px;
    flex: 0 0 auto;
    padding: 12px 14px calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(255, 243, 223, 0.08);
    background:
        linear-gradient(180deg, rgba(26, 20, 16, 0.88), rgba(20, 16, 13, 0.98));
}
.profile-edit-foot .btn {
    height: 48px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
}

@keyframes profile-ring {
    to { transform: rotate(360deg); }
}

@keyframes profile-pop {
    0% { transform: scale(0.86); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@media (max-width: 380px) {
    .avatar-picker { grid-template-columns: repeat(5, 1fr); max-height: 190px; }
    .profile-sheet .avatar-picker { max-height: none; }
    .avatar-cat { min-width: 46px; padding: 5px 6px 4px; }
    .avatar-cat-label { font-size: 0.6rem; }
    .profile-face-wrap { width: 86px; height: 86px; }
    .profile-face { width: 74px; height: 74px; font-size: 2.2rem; }
    .profile-geo { grid-template-columns: 1fr; }
}

@keyframes slide-up-soft {
    from { transform: translateY(18px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Word play ===== */
.start-pulse {
    width: 48px;
    height: 48px;
    margin: 18px auto 0;
    border-radius: 50%;
    border: 3px solid rgba(232, 165, 75, 0.45);
    animation: start-pulse 0.9s ease-in-out infinite;
}

@keyframes start-pulse {
    0% { transform: scale(0.85); opacity: 0.55; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.55; }
}

.quota-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(94, 207, 154, 0.14), rgba(232, 165, 75, 0.1));
    border: 1px solid rgba(94, 207, 154, 0.35);
    color: #e8fff4;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.55;
}

.muted-inline {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85em;
}

.writer-row.is-full span:last-child {
    color: var(--mint);
    font-weight: 700;
}

#finish-writing:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.25);
}

#finish-writing.is-ready {
    box-shadow: 0 0 0 2px rgba(94, 207, 154, 0.45);
}

.play-finish-box.is-waiting #finish-hint {
    color: #f0a398;
}

#finish-hint.is-ok {
    color: var(--mint);
}

.play-card .rule-summary {
    margin-bottom: 10px;
}

.play-rule-pin {
    margin: 0 0 6px;
}

.play-rule-sticky.is-fixed {
    position: fixed;
    z-index: 30;
    margin: 0;
}

/* نوار استیکی: یک ردیف خیلی کوتاه، بدون عنوان و بدون بلوک‌های جدا */
.play-rule-sticky .hand-rule {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 5px;
    margin-bottom: 0;
    padding: 3px 6px;
    border-radius: 8px;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 232, 200, 0.04);
}

.play-rule-sticky.is-fixed .hand-rule {
    backdrop-filter: blur(8px);
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(232, 165, 75, 0.12), transparent 55%),
        linear-gradient(160deg, rgba(49, 38, 31, 0.97), rgba(26, 20, 16, 0.96));
}

.play-rule-sticky .hand-rule-head {
    display: none;
}

.play-rule-sticky .hand-rule-diff {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 1px 6px;
    border-radius: 999px;
    gap: 4px;
}

.play-rule-sticky .hand-rule-diff-head {
    display: contents;
}

.play-rule-sticky .hand-rule-diff-label,
.play-rule-sticky .hand-rule-diff-track {
    display: none;
}

.play-rule-sticky .hand-rule-diff-value {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.15;
}

.play-rule-sticky .hand-rule-diff-tone {
    font-size: 0.62rem;
    line-height: 1.15;
}

.play-rule-sticky .hand-rule-pattern {
    display: inline-flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 1px 3px;
    border-radius: 6px;
}

.play-rule-sticky .hand-rule-axis {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 3px;
    padding: 1px 4px;
    border-radius: 5px;
}

.play-rule-sticky .hand-rule-axis-title {
    font-size: 0.58rem;
    line-height: 1.1;
}

.play-rule-sticky .hand-rule-axis-value {
    font-size: 0.78rem;
    min-height: 0;
    line-height: 1.15;
}

.play-rule-sticky .hand-rule-axis.is-any .hand-rule-axis-value {
    font-size: 0.68rem;
}

.play-rule-sticky .hand-rule-axis-plus {
    font-size: 0.7rem;
    padding: 0;
    opacity: 0.55;
}

.play-rule-sticky .hand-rule-form {
    margin: 0;
    padding: 1px 6px;
    gap: 3px;
    border-radius: 999px;
}

.play-rule-sticky .hand-rule-form-label {
    display: none;
}

.play-rule-sticky .hand-rule-form-value {
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: inherit;
}

.play-rule-sticky .hand-rule-list {
    display: contents;
}

.play-rule-sticky .hand-rule-item {
    margin: 0;
    padding: 1px 6px;
    border-radius: 999px;
    gap: 3px;
    font-size: 0.68rem;
    line-height: 1.15;
    flex: 0 1 auto;
    max-width: 100%;
}

.play-rule-sticky .hand-rule-ico {
    width: 10px;
    height: 10px;
}

.play-rule-sticky .hand-rule-item-label {
    font-size: 0.68rem;
    line-height: 1.15;
}

.play-rule-sticky .hand-rule-item-body,
.play-rule-sticky .hand-rule-item-meta {
    font-size: 0.62rem;
    line-height: 1.15;
}

.play-rule-sticky .hand-rule-item.is-length {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    border-radius: 999px;
    padding: 1px 6px;
}

.play-rule-sticky .hand-rule-item-top {
    display: contents;
}

.play-rule-sticky .hand-rule-range,
.play-rule-sticky .hand-rule-range-caption {
    display: none;
}

.play-rule-sticky .hand-rule-letter {
    min-width: 1.15em;
    height: 1.15em;
    font-size: 0.7rem;
}

.hand-rule {
    --hr-accent: var(--saffron);
    position: relative;
    margin: 0 0 14px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(232, 165, 75, 0.18), transparent 55%),
        linear-gradient(160deg, rgba(49, 38, 31, 0.95), rgba(26, 20, 16, 0.92));
    border: 1px solid rgba(232, 165, 75, 0.28);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 232, 200, 0.06);
}

.hand-rule-diff {
    margin: 0 0 12px;
    padding: 10px 12px 11px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid rgba(255, 232, 200, 0.1);
}

.hand-rule-diff-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.hand-rule-diff-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.hand-rule-diff-value {
    margin-inline-start: auto;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--saffron-hot);
}

.hand-rule-diff.is-easy .hand-rule-diff-value { color: #5ecf9a; }
.hand-rule-diff.is-mid .hand-rule-diff-value { color: #f0b85f; }
.hand-rule-diff.is-hard .hand-rule-diff-value { color: #ff8a7a; }

.hand-rule-diff-tone {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff3df;
}

.hand-rule-diff.is-easy .hand-rule-diff-tone { color: #8ee4bc; }
.hand-rule-diff.is-mid .hand-rule-diff-tone { color: #f0b85f; }
.hand-rule-diff.is-hard .hand-rule-diff-tone { color: #ff8a7a; }

.hand-rule-diff-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 232, 200, 0.12);
    direction: rtl;
}

.hand-rule-diff-spectrum {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(to left, #5ecf9a 0%, #8ee4bc 22%, #e8a54b 50%, #f0b85f 68%, #e85d4c 100%);
    opacity: 0.28;
}

.hand-rule-diff-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(to left, #3dbf88, #5ecf9a 55%, #8ee4bc);
}

.hand-rule-diff-fill.is-easy {
    background: linear-gradient(to left, #3dbf88, #5ecf9a 55%, #8ee4bc);
}

.hand-rule-diff-fill.is-mid {
    background: linear-gradient(to left, #5ecf9a, #e8a54b 55%, #f0b85f);
}

.hand-rule-diff-fill.is-hard {
    background: linear-gradient(to left, #5ecf9a, #e8a54b 40%, #e85d4c 78%, #ff6b5a);
}

.hand-rule-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.hand-rule-mark {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    background: radial-gradient(circle at 35% 35%, #ffe08a, var(--saffron) 55%, #c8782a);
    box-shadow: 0 0 0 4px rgba(232, 165, 75, 0.16);
}

.hand-rule-head-text {
    min-width: 0;
    flex: 1;
}

.hand-rule-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff3df;
    line-height: 1.3;
}

.hand-rule-pattern {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 4px;
    margin: 0 0 10px;
    padding: 10px 8px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid rgba(255, 232, 200, 0.1);
}

.hand-rule-axis-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--saffron-hot);
    opacity: 0.75;
    user-select: none;
    line-height: 1;
    padding: 0 2px;
}

.hand-rule-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 4px;
    border-radius: 10px;
    text-align: center;
}

.hand-rule-axis-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
}

.hand-rule-axis-value {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff3df;
    min-height: 1.3em;
}

.hand-rule-axis.is-any .hand-rule-axis-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.hand-rule-axis.is-active {
    background: rgba(94, 207, 154, 0.14);
    border: 1px solid rgba(94, 207, 154, 0.35);
}

.hand-rule-axis.is-active .hand-rule-axis-title {
    color: var(--mint);
}

.hand-rule-axis.is-active .hand-rule-axis-value {
    color: #b8f0d4;
}

.hand-rule-axis.is-forbid {
    background: rgba(232, 93, 76, 0.12);
    border: 1px solid rgba(232, 93, 76, 0.3);
}

.hand-rule-axis.is-forbid .hand-rule-axis-title,
.hand-rule-axis.is-forbid .hand-rule-axis-value {
    color: #ffb4a8;
}

.hand-rule-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(94, 207, 154, 0.1);
    border: 1px solid rgba(94, 207, 154, 0.28);
}

.hand-rule-form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.hand-rule-form-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: #b8f0d4;
    text-align: left;
}

.hand-rule-form.is-single {
    background: rgba(232, 165, 75, 0.1);
    border-color: rgba(232, 165, 75, 0.3);
}

.hand-rule-form.is-single .hand-rule-form-value {
    color: var(--saffron-hot);
}

.hand-rule-form.is-multi {
    background: rgba(94, 207, 154, 0.12);
    border-color: rgba(94, 207, 154, 0.35);
}

.hand-rule-form.is-both {
    background: rgba(94, 207, 154, 0.1);
    border-color: rgba(94, 207, 154, 0.28);
}

.hand-rule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hand-rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid rgba(255, 232, 200, 0.1);
    color: #fff3df;
}

.hand-rule-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--saffron-hot);
    opacity: 0.9;
}

.hand-rule-item-label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.hand-rule-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hand-rule-item-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--saffron-hot);
}

/* حرف اصلی — تاکید بصری */
.hand-rule-item.is-letter {
    background: linear-gradient(105deg, rgba(232, 165, 75, 0.16), rgba(0, 0, 0, 0.28) 42%);
    border-color: rgba(232, 165, 75, 0.28);
}

.hand-rule-letter {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1410;
    background: linear-gradient(145deg, #ffe08a, var(--saffron) 55%, #d9892f);
    box-shadow:
        0 6px 14px rgba(232, 165, 75, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hand-rule-item.is-forbid {
    background: linear-gradient(105deg, rgba(232, 93, 76, 0.14), rgba(0, 0, 0, 0.28) 42%);
    border-color: rgba(232, 93, 76, 0.28);
}

.hand-rule-item.is-forbid .hand-rule-letter {
    color: #fff3df;
    background: linear-gradient(145deg, #f08a7a, var(--coral));
    box-shadow: 0 6px 14px rgba(232, 93, 76, 0.28);
}

.hand-rule-item.is-forbid .hand-rule-ico,
.hand-rule-item.is-forbid .hand-rule-item-meta {
    color: #ff8a7a;
}

.hand-rule-item.is-form {
    background: rgba(94, 207, 154, 0.08);
    border-color: rgba(94, 207, 154, 0.22);
}

.hand-rule-item.is-form .hand-rule-ico {
    color: var(--mint);
}

.hand-rule-item.is-tag {
    background: rgba(255, 232, 200, 0.06);
}

/* بازه طول */
.hand-rule-item.is-length {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: linear-gradient(180deg, rgba(232, 165, 75, 0.1), rgba(0, 0, 0, 0.22));
    border-color: rgba(232, 165, 75, 0.22);
}

.hand-rule-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hand-rule-range {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.hand-rule-range-val {
    min-width: 1.6rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--saffron-hot);
}

.hand-rule-range-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 232, 200, 0.12);
    overflow: visible;
}

.hand-rule-range-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(232, 165, 75, 0.35), var(--saffron-hot), rgba(232, 93, 76, 0.65));
}

.hand-rule-range-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff3df;
    border: 2px solid var(--saffron);
    box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.2);
    transform: translate(-50%, -50%);
}

.hand-rule-range-dot.is-start {
    inset-inline-start: 0;
    transform: translate(-50%, -50%);
}
.hand-rule-range-dot.is-end {
    inset-inline-end: 0;
    transform: translate(50%, -50%);
}

.hand-rule-range-caption {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: -2px;
}

.play-words-box {
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-mid);
    border: 1px solid var(--line);
}

.play-words-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    color: var(--saffron-hot);
    font-size: 0.9rem;
}

.word-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.word-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: var(--surface-inset-soft);
    border: 1px solid var(--line);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.word-row-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.word-row-hint {
    margin: 0 2px 2px;
    padding: 0 4px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #ff8a7a;
}

.word-row-hint.is-hidden {
    display: none;
}

.word-row-hint.is-dup-hint {
    color: #c9a0ff;
}

.word-row-hint.is-rule-hint {
    color: #ff8a7a;
}

/* 🤬 جلوی خودِ کلمه‌ی نوشته‌شده (هم‌سطر با اینپوت) */
.word-row-forbidden-mark {
    flex: 0 0 auto;
    width: 1.35rem;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1;
    unicode-bidi: isolate;
    user-select: none;
}

.word-row-forbidden-mark.is-hidden {
    display: none;
}

.word-row.is-len-short {
    border-color: rgba(232, 93, 76, 0.45);
    background: rgba(232, 93, 76, 0.1);
}

.word-row.is-dup {
    border-color: rgba(168, 120, 255, 0.55);
    background: rgba(168, 120, 255, 0.16);
}

.word-row.is-in-dict {
    border-color: rgba(94, 207, 154, 0.55);
    background: rgba(94, 207, 154, 0.16);
}

.word-row.is-rule-bad {
    border-color: rgba(232, 93, 76, 0.5);
    background: rgba(232, 93, 76, 0.14);
}

.word-row.is-in-dict.is-rule-bad {
    border-color: rgba(232, 93, 76, 0.55);
    background: linear-gradient(90deg, rgba(94, 207, 154, 0.14), rgba(232, 93, 76, 0.14));
}

.word-row.is-dup.is-in-dict {
    border-color: rgba(168, 120, 255, 0.55);
    background: rgba(168, 120, 255, 0.16);
}

.word-row.is-in-dict .word-row-input {
    border-color: rgba(94, 207, 154, 0.35);
    background: rgba(12, 40, 28, 0.35);
}

.word-row.is-rule-bad .word-row-input {
    text-decoration: line-through;
    opacity: 0.8;
    border-color: rgba(232, 93, 76, 0.35);
    background: rgba(40, 12, 12, 0.35);
}

/* کوتاه‌تر از مینیمم: پیام لایو بدون خط‌خورده (هنوز در حال نوشتن) */
.word-row.is-len-short .word-row-input {
    text-decoration: none;
    opacity: 1;
    border-color: rgba(232, 93, 76, 0.35);
    background: rgba(40, 12, 12, 0.28);
}

.word-row.is-dup .word-row-input {
    border-color: rgba(168, 120, 255, 0.35);
    background: rgba(28, 16, 44, 0.35);
}

.word-row-dict {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--mint);
}

.word-row-dict.is-hidden {
    display: none;
}

.word-row-dict-icon {
    display: block;
}

.word-row-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 232, 200, 0.14);
    background: var(--surface-deep);
    color: var(--chip-text);
    font: inherit;
    font-size: 0.95rem;
}

.word-row-input:focus {
    outline: none;
    border-color: rgba(232, 165, 75, 0.55);
}

.word-row-score {
    min-width: 2.4rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--saffron-hot);
}

.word-row-score.is-empty {
    color: var(--muted);
    font-weight: 500;
}

.word-row-hint.is-hint-suggest {
    color: rgba(142, 196, 255, 0.95);
    font-weight: 600;
}

.word-row-hint-btn {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(142, 196, 255, 0.35);
    background: rgba(142, 196, 255, 0.1);
    color: rgba(200, 228, 255, 0.95);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.word-row-hint-btn:hover:not(:disabled) {
    border-color: rgba(142, 196, 255, 0.65);
    background: rgba(142, 196, 255, 0.18);
    color: #eef6ff;
}

.word-row-hint-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.word-row-add,
.word-row-del {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-inset);
    color: var(--chip-text);
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.word-row-add:hover { border-color: rgba(94, 207, 154, 0.5); color: var(--mint); }
.word-row-del:hover { border-color: rgba(232, 93, 76, 0.5); color: #ff8a7a; }
.word-row-add:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.word-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(232, 165, 75, 0.14), rgba(94, 207, 154, 0.08));
    border: 1px solid rgba(232, 165, 75, 0.28);
    color: var(--muted);
    font-size: 0.9rem;
}

.word-total-bar strong {
    color: var(--saffron-hot);
    font-size: 1.15rem;
}

.word-chips {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(232, 165, 75, 0.12);
    border: 1px solid rgba(232, 165, 75, 0.28);
    font-size: 0.88rem;
}

.word-chip-meta {
    font-size: 0.7rem;
    color: var(--muted);
}

.word-chip-x {
    border: 0;
    background: transparent;
    color: #ff8a7a;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.word-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.word-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-inset);
    color: inherit;
    font: inherit;
}

.writers-box {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-faint);
    border: 1px solid var(--line);
}

.writer-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.writer-row:last-child { border-bottom: 0; }
.writer-row.is-done { color: #5ecf9a; }

.writer-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.writer-avatar {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.writer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6b6358;
    box-shadow: 0 0 0 2px rgba(107, 99, 88, 0.25);
}

.writer-row.is-online .writer-dot {
    background: #3dcf8a;
    box-shadow: 0 0 0 2px rgba(61, 207, 138, 0.28), 0 0 10px rgba(61, 207, 138, 0.45);
}

.writer-row.is-offline {
    opacity: 0.72;
}

.writer-row.is-left .writer-name {
    color: var(--muted);
}

.writer-left-tag {
    font-style: normal;
    font-size: 0.72rem;
    color: #c9a894;
    font-weight: 600;
}

.btn-leave-game {
    border-color: rgba(232, 93, 76, 0.4) !important;
    color: #ffb0a4 !important;
}

.afk-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--overlay-heavy);
    backdrop-filter: blur(2px);
}

.afk-panel {
    text-align: center;
    max-width: 360px;
    color: var(--chip-text);
}

.afk-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
}

.afk-count {
    margin: 0 0 14px;
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    color: #e8a54b;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 24px rgba(232, 165, 75, 0.35);
}

.afk-body {
    margin: 0 0 10px;
    font-size: 1rem;
    line-height: 1.55;
    color: #f2dfc6;
}

.afk-hint {
    margin: 0;
    font-size: 0.88rem;
    color: #5ecf9a;
    font-weight: 700;
}

body.afk-warn-open {
    overflow: hidden;
}

.results-list {
    display: grid;
    gap: 14px;
    margin: 0 0 20px;
}

.round-results-card {
    overflow: hidden;
}

.round-results-head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.round-results-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.round-results-title {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 1.55rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
}

.result-player-card {
    position: relative;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.result-player-card.is-winner {
    border-color: rgba(94, 207, 154, 0.45);
    background: linear-gradient(155deg, rgba(94, 207, 154, 0.14), rgba(255, 255, 255, 0.03));
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.result-player-card.is-winner::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, transparent, #5ecf9a, transparent);
}

.result-player-card.is-me {
    outline: 1px solid rgba(232, 165, 75, 0.35);
    outline-offset: -1px;
}

.result-player-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.result-player-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.result-player-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text);
    background: linear-gradient(145deg, rgba(232, 165, 75, 0.22), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(232, 165, 75, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.result-player-card.is-winner .result-player-avatar {
    background: linear-gradient(145deg, rgba(94, 207, 154, 0.28), rgba(255, 255, 255, 0.06));
    border-color: rgba(94, 207, 154, 0.4);
}

.result-player-meta {
    min-width: 0;
    flex: 1;
}

.result-player-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.result-player-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.result-player-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.result-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-badge.is-win {
    background: rgba(94, 207, 154, 0.2);
    color: #8ef0b8;
    border-color: rgba(94, 207, 154, 0.35);
}

.result-badge.is-early {
    background: rgba(232, 165, 75, 0.16);
    color: #f0c88a;
    border-color: rgba(232, 165, 75, 0.28);
}

.result-badge.is-me {
    background: rgba(140, 160, 255, 0.14);
    color: #b8c4ff;
    border-color: rgba(140, 160, 255, 0.28);
}

.result-badge.is-left {
    background: rgba(255, 120, 120, 0.14);
    color: #ffb0b0;
    border-color: rgba(255, 120, 120, 0.28);
}

.result-player-total {
    flex: 0 0 auto;
    text-align: left;
    min-width: 72px;
}

.result-player-total-label {
    display: block;
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.result-player-total-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    color: var(--saffron-hot);
    font-variant-numeric: tabular-nums;
}

.result-player-card.is-winner .result-player-total-value {
    color: #5ecf9a;
    text-shadow: 0 0 20px rgba(94, 207, 154, 0.25);
}

.result-player-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.result-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.result-metric.is-accent {
    background: rgba(232, 165, 75, 0.1);
    border-color: rgba(232, 165, 75, 0.18);
}

.result-metric-label {
    font-size: 0.66rem;
    color: var(--muted);
    line-height: 1.3;
}

.result-metric-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.result-player-card.is-empty-words {
    border-color: rgba(232, 93, 76, 0.35);
    background: linear-gradient(160deg, rgba(232, 93, 76, 0.1), rgba(255, 255, 255, 0.02));
}

.result-empty-words {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
    color: #f0a398;
    background: rgba(232, 93, 76, 0.08);
    border: 1px dashed rgba(232, 93, 76, 0.28);
}

.result-no-words-alert {
    margin: 0 0 16px;
    border-radius: 14px;
}

.result-word-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.result-word-chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 16px;
    font-size: 0.82rem;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

.result-word-chip .vote-marks {
    flex: 1 1 100%;
    margin: 2px 0 0;
}

.result-word-reacts {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 2px 0 0;
}

.result-word-react {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 243, 223, 0.08);
    border: 1px solid rgba(255, 232, 200, 0.12);
    font-size: 0.72rem;
    line-height: 1;
}

.result-word-react-emoji {
    font-size: 0.9rem;
}

.result-word-react-count {
    font-weight: 800;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.result-word-chip .vote-mark {
    width: 0.95em;
    height: 0.95em;
    font-size: 0.58rem;
}

.result-word-chip.is-scored {
    background: rgba(94, 207, 154, 0.12);
    border-color: rgba(94, 207, 154, 0.28);
}

.result-word-chip.is-invalid {
    background: rgba(180, 120, 255, 0.1);
    border-color: rgba(180, 120, 255, 0.22);
    opacity: 0.88;
}

.result-word-chip.is-rejected {
    background: rgba(232, 93, 76, 0.1);
    border-color: rgba(232, 93, 76, 0.28);
    opacity: 0.9;
}

.result-word-chip.is-dup {
    background: rgba(180, 120, 255, 0.14);
    border-color: rgba(180, 120, 255, 0.38);
}
.result-word-chip.is-dup .result-word-text {
    text-decoration: line-through;
    color: #d7b7ff;
}
.result-word-chip.is-dup .result-word-score {
    background: rgba(180, 120, 255, 0.22);
    color: #e4c8ff;
}
.result-word-chip.is-dup-split {
    background: rgba(232, 165, 75, 0.14);
    border-color: rgba(232, 165, 75, 0.4);
}
.result-word-chip.is-dup-split .result-word-score {
    background: rgba(232, 165, 75, 0.22);
    color: #ffd59a;
}

.result-word-text {
    font-weight: 700;
    color: var(--text);
}

.result-word-chip.is-invalid .result-word-text,
.result-word-chip.is-rejected .result-word-text {
    text-decoration: line-through;
    color: var(--muted);
}

.result-word-score {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--saffron);
    font-variant-numeric: tabular-nums;
}

.result-word-chip.is-scored .result-word-score {
    background: rgba(94, 207, 154, 0.22);
    color: #8ef0b8;
}

.result-word-chip.is-invalid .result-word-score,
.result-word-chip.is-rejected .result-word-score {
    background: rgba(232, 93, 76, 0.18);
    color: #ff9a8a;
}

.result-word-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(196, 75, 75, 0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .result-player-top {
        flex-direction: column;
        align-items: stretch;
    }

    .result-player-total {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .result-player-total-value {
        font-size: 1.65rem;
    }

    .result-player-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .result-player-metrics .result-metric.is-accent {
        grid-column: 1 / -1;
    }
}

/* —— کارناوال الماس (۵ ثانیه، فقط برای برندهٔ الماس) —— */
.diamond-carnival-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(ellipse 90% 70% at 50% 18%, rgba(255, 209, 102, 0.22), transparent 55%),
        radial-gradient(ellipse 70% 50% at 20% 80%, rgba(247, 37, 133, 0.18), transparent 50%),
        radial-gradient(ellipse 60% 45% at 85% 70%, rgba(76, 201, 240, 0.16), transparent 48%),
        linear-gradient(165deg, #0b1220 0%, #1a0f24 48%, #0d1b2a 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    cursor: pointer;
    overflow: hidden;
}

.diamond-carnival-overlay.is-open {
    opacity: 1;
}

.diamond-carnival-overlay.is-leaving {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.dc-stage {
    position: relative;
    width: min(420px, 100%);
    z-index: 1;
}

.dc-ribbons,
.dc-sparks {
    position: absolute;
    inset: -40vh -10vw 0;
    pointer-events: none;
    overflow: hidden;
}

.dc-ribbon {
    position: absolute;
    top: -12%;
    left: var(--dc-left, 50%);
    width: var(--dc-w, 10px);
    height: 42px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--dc-color, #ffd166), transparent);
    opacity: 0.85;
    transform-origin: center top;
    animation: dc-ribbon-fall var(--dc-dur, 3s) var(--dc-delay, 0s) linear infinite;
}

.dc-ribbon::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 14px;
    height: 10px;
    margin-left: -7px;
    border-radius: 0 0 6px 6px;
    background: var(--dc-color, #ffd166);
    opacity: 0.9;
}

.dc-spark {
    position: absolute;
    top: -4%;
    left: var(--dc-left, 50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff8e7;
    box-shadow: 0 0 8px 2px rgba(255, 209, 102, 0.75);
    animation: dc-spark-fall 2.8s var(--dc-delay, 0s) ease-in infinite;
}

.dc-burst {
    position: absolute;
    left: 50%;
    top: 28%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 209, 102, 0.2) 35%, transparent 70%);
    animation: dc-burst-pulse 1.4s ease-in-out infinite;
    pointer-events: none;
}

.dc-card {
    position: relative;
    text-align: center;
    padding: 28px 22px 22px;
    border-radius: 28px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
        rgba(12, 18, 32, 0.72);
    border: 1px solid rgba(255, 209, 102, 0.35);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(18px) scale(0.94);
    opacity: 0;
    animation: dc-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.dc-gem-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
}

.dc-gem-glow {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(77, 201, 240, 0.55), transparent 70%);
    filter: blur(6px);
    animation: dc-glow 1.8s ease-in-out infinite;
}

.dc-gem {
    position: relative;
    font-size: 3.4rem;
    line-height: 1;
    filter: drop-shadow(0 8px 18px rgba(76, 201, 240, 0.45));
    animation: dc-gem-bounce 1.1s ease-in-out infinite;
}

.dc-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffd166;
    text-transform: none;
}

.dc-title {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 4.5vw, 1.55rem);
    font-weight: 800;
    line-height: 1.45;
    color: #fff8f0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.dc-sub {
    margin: 0 auto 18px;
    max-width: 28ch;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(255, 248, 240, 0.78);
}

.dc-timer {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.dc-timer-bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: right center;
    background: linear-gradient(90deg, #ffd166, #4cc9f0, #f72585);
    animation: dc-timer-shrink 5s linear forwards;
}

@keyframes dc-ribbon-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    8% { opacity: 0.9; }
    100% { transform: translateY(120vh) rotate(28deg); opacity: 0.15; }
}

@keyframes dc-spark-fall {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateY(110vh) scale(1.2); opacity: 0; }
}

@keyframes dc-burst-pulse {
    0%, 100% { transform: scale(0.85); opacity: 0.55; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes dc-card-in {
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes dc-gem-bounce {
    0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
    50% { transform: translateY(-8px) rotate(6deg) scale(1.08); }
}

@keyframes dc-glow {
    0%, 100% { opacity: 0.55; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

@keyframes dc-timer-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .dc-ribbon,
    .dc-spark,
    .dc-burst,
    .dc-gem,
    .dc-gem-glow,
    .dc-card,
    .dc-timer-bar {
        animation: none !important;
    }
    .dc-card {
        opacity: 1;
        transform: none;
    }
    .dc-timer-bar {
        width: 0;
        transition: width 5s linear;
    }
    .diamond-carnival-overlay.is-open .dc-timer-bar {
        width: 0;
    }
}

/* legacy vote view */
.result-words {
    margin: 0;
    padding: 0;
    list-style: none;
}
.result-words .is-dup {
    color: #ff8a7a;
    text-decoration: line-through;
}

.continue-vote-box {
    margin: 16px 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.continue-invite {
    margin: 12px 0 8px;
}

.continue-invite .code-panel {
    margin-top: 6px;
}

.continue-vote-timer {
    text-align: center;
    margin: 8px 0 10px;
}

.session-end-card .session-end-alert {
    text-align: center;
    font-weight: 700;
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0 14px;
}

.session-stat {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 12px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 243, 223, 0.1);
    background: var(--surface-mid);
}

.session-stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

.session-stat-label {
    font-size: 0.72rem;
    color: var(--muted);
}

.session-coins {
    margin-bottom: 16px;
}

.continue-vote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 14px;
}

.continue-vote-list {
    display: grid;
    gap: 6px;
}

.continue-vote-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--muted);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.continue-vote-row:last-child { border-bottom: 0; }

.word-vote-list {
    display: grid;
    gap: 14px;
    margin: 14px 0;
}

.word-vote-list.is-entering .word-vote-box {
    animation: voteBoxIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.word-vote-list.is-entering .word-vote-box:nth-child(1) { animation-delay: 0.04s; }
.word-vote-list.is-entering .word-vote-box:nth-child(2) { animation-delay: 0.11s; }
.word-vote-list.is-entering .word-vote-box:nth-child(3) { animation-delay: 0.18s; }
.word-vote-list.is-entering .word-vote-box:nth-child(4) { animation-delay: 0.24s; }
.word-vote-list.is-entering .word-vote-box:nth-child(n+5) { animation-delay: 0.3s; }

@keyframes voteBoxIn {
    from {
        opacity: 0;
        transform: translate3d(0, 16px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .word-vote-list.is-entering .word-vote-box {
        animation: none;
    }
}

.word-vote-box {
    --wv-accent: #c4a484;
    --wv-accent-soft: rgba(196, 164, 132, 0.14);
    border-radius: 16px;
    border: 3px solid var(--wv-accent);
    background:
        linear-gradient(180deg, var(--wv-accent-soft), transparent 42%),
        var(--surface-mid);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.22),
        0 8px 18px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.word-vote-box.is-tone-0 {
    --wv-accent: #5ecf9a;
    --wv-accent-soft: rgba(94, 207, 154, 0.14);
}
.word-vote-box.is-tone-1 {
    --wv-accent: #7eb6ff;
    --wv-accent-soft: rgba(126, 182, 255, 0.14);
}
.word-vote-box.is-tone-2 {
    --wv-accent: #c084fc;
    --wv-accent-soft: rgba(192, 132, 252, 0.14);
}
.word-vote-box.is-tone-3 {
    --wv-accent: #f0b85f;
    --wv-accent-soft: rgba(240, 184, 95, 0.16);
}
.word-vote-box.is-tone-4 {
    --wv-accent: #ff8a7a;
    --wv-accent-soft: rgba(255, 138, 122, 0.14);
}
.word-vote-box.is-tone-5 {
    --wv-accent: #5ec8d4;
    --wv-accent-soft: rgba(94, 200, 212, 0.14);
}

.word-vote-box.is-mine,
.word-vote-box.is-tone-mine {
    --wv-accent: #e8a54b;
    --wv-accent-soft: rgba(232, 165, 75, 0.18);
    border-color: var(--wv-accent);
    background:
        linear-gradient(180deg, rgba(232, 165, 75, 0.16), transparent 48%),
        var(--surface-mid);
}

.word-vote-box-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 9px;
    border-bottom: 2px solid color-mix(in srgb, var(--wv-accent) 45%, transparent);
    background: color-mix(in srgb, var(--wv-accent) 10%, transparent);
}

.word-vote-box-who {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.word-vote-box-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    line-height: 1;
    background: linear-gradient(145deg, color-mix(in srgb, var(--wv-accent) 28%, transparent), rgba(255, 255, 255, 0.06));
    border: 2px solid color-mix(in srgb, var(--wv-accent) 55%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.word-vote-box-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.word-vote-box-head strong {
    font-size: 0.98rem;
    line-height: 1.25;
}

.word-vote-box-head .hint {
    margin: 0;
    font-size: 0.78rem;
}

.word-vote-box-body {
    display: grid;
    gap: 0;
}

.word-vote-card {
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
}

.word-vote-box-body .word-vote-card:last-child {
    border-bottom: 0;
}

.word-vote-card.is-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}

.word-vote-card.is-mine {
    border-color: transparent;
}

.word-vote-score {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--mint, #5ecf9a);
    min-width: 2ch;
}

.word-vote-score.is-empty {
    color: var(--muted);
    font-weight: 500;
}

.word-vote-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.word-vote-meta strong {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.word-vote-meta .hint {
    margin: 0;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vote-marks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    margin: 4px 0 2px;
}

.vote-mark {
    width: 1.15em;
    height: 1.15em;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.vote-mark.is-yes {
    background: #1f8a5b;
    color: #edfff6;
}

.vote-mark.is-no {
    background: #c44b4b;
    color: #fff4f3;
}

.vote-mark.is-wait {
    background: #6b7280;
    color: #e5e7eb;
}

.timer-notice {
    margin: 8px 0 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--chip-text, #f3e7dc);
    font-size: 0.86rem;
    line-height: 1.5;
}

.lobby-cap {
    text-align: center;
    margin: 8px 0 4px;
}

.word-vote-status {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
    font-size: 0.78rem;
}

.word-vote-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.word-vote-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    flex: 0 0 auto;
}

.word-vote-actions .btn {
    min-width: 52px;
    padding: 6px 12px;
    white-space: nowrap;
}

.word-vote-actions .vote-approve {
    background: #1f8a5b;
    border-color: #1f8a5b;
    color: #fff;
}

.word-vote-actions .vote-approve:hover {
    background: #187a4f;
    border-color: #187a4f;
}

.word-vote-actions .vote-reject {
    background: #c44b4b;
    border-color: #c44b4b;
    color: #fff;
}

.word-vote-actions .vote-reject:hover {
    background: #ad3f3f;
    border-color: #ad3f3f;
}

.word-vote-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.word-vote-card-wrap .word-vote-card {
    margin-bottom: 0;
}

.word-react-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 2px 2px;
}

.word-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 232, 200, 0.14);
    background: rgba(255, 243, 223, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.word-react-btn:hover:not(:disabled) {
    background: rgba(232, 165, 75, 0.14);
    border-color: rgba(232, 165, 75, 0.4);
}

.word-react-btn.is-on {
    background: rgba(94, 207, 154, 0.18);
    border-color: rgba(94, 207, 154, 0.55);
    box-shadow: 0 0 0 1px rgba(94, 207, 154, 0.18);
}

.word-react-btn.is-readonly {
    cursor: default;
    opacity: 0.92;
}

.word-react-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.word-react-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 0.9em;
}

.word-vote-card.is-rule-rejected {
    opacity: 0.78;
}

.word-vote-card.is-forbidden-hidden .word-vote-forbidden-label {
    font-style: italic;
    opacity: 0.9;
}

.early-finish-banner {
    margin: 0.65rem 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(232, 165, 75, 0.12);
    border: 1px solid rgba(232, 165, 75, 0.35);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.early-finish-banner strong {
    font-size: 0.95rem;
}

.early-finish-rewards {
    font-size: 0.85rem;
    opacity: 0.9;
}

.early-finish-banner.is-results {
    margin-top: 0;
    margin-bottom: 1rem;
}

.result-word-chip.is-forbidden-hidden .result-word-text {
    font-style: italic;
    opacity: 0.85;
}

.word-vote-card.is-dict-accepted {
    background: rgba(94, 207, 154, 0.1);
}

.word-vote-card.is-vote-accepted {
    background: rgba(120, 170, 255, 0.1);
}

.word-vote-card.is-vote-rejected {
    opacity: 0.78;
}

.word-vote-card.is-needs-vote {
    background: rgba(232, 165, 75, 0.08);
}

.word-vote-dict-badge {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(94, 207, 154, 0.95);
}

.word-vote-dict-badge.is-pending {
    color: rgba(232, 165, 75, 0.95);
}

.word-vote-dict-badge.is-voted {
    color: rgba(140, 180, 255, 0.98);
}

.word-vote-dict-badge.is-rejected {
    color: rgba(220, 110, 110, 0.95);
}

.word-vote-ok {
    flex: 0 0 auto;
    color: var(--mint, #5ecf9a);
    font-weight: 800;
    font-size: 1.1rem;
}

.word-vote-card .is-struck,
.result-words .is-rule-rejected {
    text-decoration: line-through;
}

.word-vote-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #c44b4b;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1;
}

/* —— تبلیغات کسب‌وکار (پنل کاربر) —— */
.biz-ads-hub {
    margin: 10px 0;
}
.biz-ads-hub-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
}
.biz-ads-hub .btn {
    margin-top: 8px;
    width: 100%;
}
.biz-ads-screen h2 {
    margin: 12px 0 8px;
}
.biz-ads-screen h3 {
    margin: 8px 0;
    font-size: 1rem;
}
.biz-ads-calc {
    display: grid;
    gap: 12px;
}
.biz-ads-approved-head {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(61, 191, 138, 0.28);
    background: rgba(61, 191, 138, 0.08);
}
.biz-ads-approved-head .hint { margin: 6px 0 0; }
.biz-ads-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(61, 191, 138, 0.2);
    color: #9fe8c8;
    font-size: 0.72rem;
    font-weight: 700;
}
.biz-ads-formula {
    font-size: 0.78rem;
}
.biz-ads-section {
    margin: 0 0 12px;
    padding: 12px 12px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.12);
}
.biz-ads-section legend {
    padding: 0 6px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text);
}
.biz-ads-audience-grid {
    display: grid;
    gap: 8px;
}
@media (min-width: 560px) {
    .biz-ads-audience-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.biz-ads-audience-card {
    display: block;
    cursor: pointer;
}
.biz-ads-audience-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.biz-ads-audience-card-body {
    display: grid;
    gap: 4px;
    min-height: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.16);
    transition: border-color 0.18s ease, background 0.18s ease;
}
.biz-ads-audience-card-body strong {
    font-size: 0.84rem;
    color: var(--text);
}
.biz-ads-audience-card-body em {
    font-style: normal;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--muted);
}
.biz-ads-audience-card input:checked + .biz-ads-audience-card-body {
    border-color: rgba(232, 165, 75, 0.55);
    background: rgba(232, 165, 75, 0.12);
}
.biz-ads-audience-card input:focus-visible + .biz-ads-audience-card-body {
    outline: 2px solid rgba(232, 165, 75, 0.55);
    outline-offset: 2px;
}
.biz-geo-panel {
    margin-top: 10px;
}
.biz-geo-panel.is-hidden {
    display: none !important;
}
.biz-geo-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}
.biz-geo-count {
    min-width: 1.5rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(232, 165, 75, 0.18);
    color: #f0d2a0;
    font-size: 0.72rem;
    text-align: center;
}
.biz-geo-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow: auto;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.14);
}
@media (min-width: 560px) {
    .biz-geo-checks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.biz-geo-check {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text);
    cursor: pointer;
}
.biz-geo-check:hover {
    background: rgba(255, 255, 255, 0.04);
}
.biz-geo-check input {
    margin-top: 2px;
    flex-shrink: 0;
}
.biz-ads-checks,
.biz-ads-addons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 10px 0 14px;
}
.biz-ads-checks label,
.biz-ads-addons label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.biz-ads-status {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.12);
}
.biz-ads-status.is-pending {
    border: 1px solid rgba(232, 165, 75, 0.35);
}
.biz-ads-status.is-rejected {
    border: 1px solid rgba(229, 115, 115, 0.35);
}
.biz-ads-status.is-suspended {
    border: 1px solid rgba(139, 149, 171, 0.35);
}
.biz-ads-quote {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
}
.biz-ads-quote-usd {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 800;
}
.biz-ads-quote-usd span {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
}
.biz-ads-breakdown {
    margin: 0;
    padding: 0 16px 0 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* —— استان‌های برتر (صفحه ورود) —— */
.auth-top-provinces {
    margin-bottom: 10px;
}
.auth-top-provinces-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    text-align: center;
}
.auth-top-provinces-heading {
    min-width: 0;
    flex: none;
    width: 100%;
    text-align: center;
}
.auth-top-provinces-title {
    margin: 0 0 7px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--heading-strong, var(--text));
    letter-spacing: -0.015em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    text-align: center;
}
.auth-top-provinces-hint {
    margin: 0 auto;
    max-width: 52ch;
    line-height: 1.95;
    color: var(--muted);
    font-size: 0.93rem;
    text-align: center;
    transition: opacity 0.24s ease, transform 0.24s ease;
}
.auth-top-provinces-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid rgba(var(--saffron-rgb, 232, 165, 75), 0.22);
    background: var(--surface-inset);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    gap: 0;
    align-self: center;
}
.auth-top-provinces-switch-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(244, 214, 160, 0.22), rgba(232, 165, 75, 0.16));
    border: 1px solid rgba(232, 165, 75, 0.38);
    box-shadow: 0 1px 0 rgba(255, 248, 230, 0.06);
    pointer-events: none;
    transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, width;
}
.auth-top-provinces-switch-btn {
    appearance: none;
    position: relative;
    z-index: 1;
    border: 0;
    margin: 0;
    padding: 7px 13px;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    transition: color 0.28s ease;
}
.auth-top-provinces-switch-btn:hover {
    color: var(--text);
}
.auth-top-provinces-switch-btn.is-active {
    color: var(--heading-strong, var(--text));
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.auth-top-provinces-switch-btn:focus-visible {
    outline: 2px solid var(--saffron);
    outline-offset: 2px;
}

.auth-top-provinces-panels {
    position: relative;
    min-height: 120px;
}
.auth-top-provinces-panel {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.992);
    filter: blur(1px);
    transition:
        opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.46s;
}
.auth-top-provinces-panel.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    filter: none;
    transition:
        opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0s;
}
.auth-top-provinces-panel.is-leaving {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.992);
    filter: blur(1px);
    z-index: 1;
}
.auth-top-provinces-panel.is-entering {
    animation: authProvPanelIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authProvPanelIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.992);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
.auth-top-provinces.is-map-active .auth-top-provinces-hint {
    opacity: 0.96;
}

#auth-top-provinces-list .honor-top-row {
    background: rgba(0, 0, 0, 0.12);
}
#auth-top-provinces-list .honor-top-row.is-gold {
    background: rgba(255, 214, 102, 0.1);
}
#auth-top-provinces-list .honor-top-row.is-silver {
    background: rgba(223, 230, 238, 0.08);
}
#auth-top-provinces-list .honor-top-row.is-bronze {
    background: rgba(224, 177, 132, 0.1);
}
#auth-top-provinces-list .honor-empty,
#auth-top-provinces-axis .honor-empty {
    color: var(--muted, rgba(255, 255, 255, 0.55));
}

/* —— نقشه رقابت (محور امتیاز استان‌ها) —— */
.auth-race-map {
    position: relative;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: var(--arm-bg);
    border: 1px solid var(--arm-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}
.auth-race-map-head {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-bottom: 8px;
}
.auth-race-map-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--arm-title);
    letter-spacing: -0.01em;
}
.auth-race-map-caption {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--arm-caption);
}
.auth-race-map-stage {
    overflow: hidden;
    padding: 2px 2px 0;
}
.auth-race-map-track {
    position: relative;
    width: 100%;
    height: 92px;
    margin: 0;
}
.auth-race-map-line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--arm-line);
}
.auth-race-map-line::before,
.auth-race-map-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: var(--arm-dot-start);
}
.auth-race-map-line::before { left: 0; }
.auth-race-map-line::after { right: 0; background: var(--arm-dot-end); }
.auth-race-map-ends {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--arm-ends);
    letter-spacing: 0.02em;
}
.auth-race-map-dot {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    position: absolute;
    bottom: 21px;
    width: 22px;
    height: 22px;
    background: transparent;
    transform: translateX(-50%);
    cursor: default;
    z-index: 1;
    opacity: 0;
}
.auth-top-provinces-panel.is-animated .auth-race-map-dot {
    animation: authRaceDotIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--race-i, 0) * 45ms);
}
@keyframes authRaceDotIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px) scale(0.75);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}
.auth-race-map-marker {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: var(--arm-marker);
    border: 1.5px solid var(--arm-marker-border);
    box-shadow:
        0 0 0 3px var(--arm-marker-ring),
        0 0 10px var(--arm-marker-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.auth-race-map-dot.is-leader {
    z-index: 2;
}
.auth-race-map-dot.is-leader .auth-race-map-marker {
    width: 13px;
    height: 13px;
    background: var(--arm-leader);
    border-color: var(--arm-leader-border);
    box-shadow:
        0 0 0 3px var(--arm-leader-ring),
        0 0 12px var(--arm-leader-glow);
}
.auth-race-map-dot:hover .auth-race-map-marker,
.auth-race-map-dot:focus-visible .auth-race-map-marker {
    transform: translateX(-50%) scale(1.12);
}
.auth-race-map-rank {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    min-width: 18px;
    padding: 1px 4px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    text-align: center;
    color: var(--arm-rank-fg);
    background: var(--arm-rank-bg);
    border: 1px solid var(--arm-rank-border);
    pointer-events: none;
}
.auth-race-map-dot.is-leader .auth-race-map-rank {
    color: var(--arm-leader-rank-fg);
    border-color: var(--arm-leader-rank-border);
    background: var(--arm-leader-rank-bg);
}
.auth-race-map-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-race-map-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) minmax(52px, 72px) 44px;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--arm-row-bg);
    border: 1px solid var(--arm-row-border);
}
.auth-race-map-row.is-leader {
    background: var(--arm-leader-row-bg);
    border-color: var(--arm-leader-row-border);
}
.auth-race-map-row-rank {
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--arm-row-rank-fg);
    text-align: center;
}
.auth-race-map-row.is-leader .auth-race-map-row-rank {
    color: var(--arm-leader-row-rank-fg);
}
.auth-race-map-row-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--arm-row-name);
    line-height: 1.35;
    word-break: break-word;
}
.auth-race-map-row.is-leader .auth-race-map-row-name {
    color: var(--arm-leader-row-name);
}
.auth-race-map-row-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--arm-bar-track);
    overflow: hidden;
}
.auth-race-map-row-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--arm-bar-fill);
}
.auth-race-map-row.is-leader .auth-race-map-row-bar i {
    background: var(--arm-leader-bar-fill);
}
.auth-race-map-row-score {
    font-size: 0.74rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--arm-row-score);
    text-align: left;
}
.auth-race-map-row.is-leader .auth-race-map-row-score {
    color: var(--arm-leader-row-score);
}
.auth-race-map-dot:focus-visible {
    outline: none;
}
.auth-race-map-dot:focus-visible .auth-race-map-marker {
    outline: 2px solid var(--arm-focus-outline);
    outline-offset: 3px;
}
.auth-race-map-legend {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--arm-legend-border);
}
.auth-race-map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--arm-legend-item-fg);
}
.auth-race-map-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.auth-race-map-swatch.is-peer {
    background: var(--arm-swatch-peer);
    box-shadow: 0 0 0 2px var(--arm-swatch-peer-ring);
}
.auth-race-map-swatch.is-lead {
    background: var(--arm-swatch-lead);
    box-shadow: 0 0 0 2px var(--arm-swatch-lead-ring);
}

@media (max-width: 480px) {
    .auth-top-provinces-switch {
        align-self: center;
    }
    .auth-top-provinces-hint {
        max-width: none;
    }
    .auth-race-map-track {
        height: 84px;
    }
    .auth-race-map-row {
        grid-template-columns: 24px minmax(0, 1fr) 44px;
        gap: 6px;
    }
    .auth-race-map-row-bar {
        display: none;
    }
    .auth-race-map-row-score {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-top-provinces-switch-pill,
    .auth-top-provinces-panel,
    .auth-top-provinces-panel.is-entering,
    .auth-top-provinces-panel.is-animated .auth-race-map-dot,
    .auth-race-map-marker {
        transition: none !important;
        animation: none !important;
    }
}

/* —— نقشه امتیاز استان‌ها —— */
.iran-map-card {
    margin-top: 2px;
}
.iran-map-card.is-embedded {
    margin-top: 0;
}
.iran-map-card.is-embedded .iran-map-stage {
    padding-top: 4px;
}

.iran-map-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.iran-map-hint {
    margin: 0 0 12px;
}

.iran-map-stage {
    position: relative;
    width: 100%;
}

.iran-map-svg-wrap {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.iran-map-svg-wrap svg.map_agency {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.iran-map-svg-wrap g.border path.iran {
    fill: none;
    stroke: rgba(255, 232, 200, 0.18);
    stroke-width: 1.4;
    pointer-events: none;
}

.iran-map-svg-wrap g.sea path,
.iran-map-svg-wrap g.lake path {
    fill: #4aa7c9;
    fill-opacity: 0.55;
    stroke: none;
    pointer-events: none;
}

/* خلیج فارس + دریای عمان = استان مجازی جزایر (۳۲) — کل پهنهٔ آبی جنوب */
.iran-map-svg-wrap g.sea a.persian-gulf-hit,
.iran-map-svg-wrap g.sea path.persian-gulf,
.bi-map-svg-wrap g.sea a.persian-gulf-hit,
.bi-map-svg-wrap g.sea path.persian-gulf {
    cursor: pointer;
    outline: none;
    pointer-events: visiblePainted;
}

.iran-map-svg-wrap g.sea path.persian-gulf,
.bi-map-svg-wrap g.sea path.persian-gulf {
    fill: #4aa7c9;
    fill-opacity: 0.55;
    fill-rule: evenodd;
}

.iran-map-svg-wrap g.sea path.persian-gulf.is-hot,
.bi-map-svg-wrap g.sea path.persian-gulf.is-hot {
    fill-opacity: 0.82;
    filter: brightness(1.14);
}

.iran-map-svg-wrap g.island a.persian-gulf-islands,
.bi-map-svg-wrap g.island a.persian-gulf-islands {
    cursor: pointer;
    outline: none;
}

.iran-map-svg-wrap g.island path,
.bi-map-svg-wrap g.island path {
    fill: #6f655c;
    fill-opacity: 0.35;
    stroke: none;
    pointer-events: visiblePainted;
    cursor: pointer;
}

.iran-map-svg-wrap g.island path.is-hot,
.bi-map-svg-wrap g.island path.is-hot {
    filter: brightness(1.18);
    stroke: #fff4e4;
    stroke-width: 1.6;
    stroke-opacity: 1;
}

.iran-map-svg-wrap g.province > a {
    cursor: pointer;
    outline: none;
}

.iran-map-svg-wrap g.province > a path {
    fill: #6f655c;
    fill-opacity: 0.16;
    stroke: rgba(246, 239, 230, 0.88);
    stroke-width: 2.4;
    stroke-linejoin: round;
    stroke-linecap: round;
    paint-order: stroke fill;
}

.iran-map-svg-wrap g.province > a path.is-hot {
    filter: brightness(1.18);
    stroke: #fff4e4;
    stroke-width: 3.2;
}

.iran-map-tip {
    position: absolute;
    z-index: 3;
    min-width: 168px;
    max-width: 248px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(36, 28, 23, 0.96);
    border: 1px solid rgba(232, 165, 75, 0.35);
    box-shadow: var(--shadow);
    pointer-events: none;
    font-size: 0.8rem;
    line-height: 1.45;
}

.iran-map-tip-name {
    font-weight: 800;
    margin-bottom: 4px;
}

.iran-map-tip-national,
.iran-map-tip-city-rank {
    font-weight: 600;
    color: var(--saffron);
    font-size: 0.74rem;
    white-space: nowrap;
}

.iran-map-tip-score {
    margin-bottom: 6px;
}

.iran-map-tip-score strong {
    color: var(--saffron-hot);
}

.iran-map-tip-ranks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: rgba(246, 239, 230, 0.92);
    font-size: 0.76rem;
}

.iran-map-tip-rank-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.iran-map-tip-rank-row strong {
    color: var(--saffron);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    flex-shrink: 0;
}

.iran-map-tip-coin-n.is-gold { color: #ffd666 !important; }
.iran-map-tip-coin-n.is-silver { color: #dfe6ee !important; }
.iran-map-tip-coin-n.is-bronze { color: #e0b184 !important; }

.iran-map-tip-meta {
    color: var(--muted);
    font-size: 0.74rem;
    margin-top: 4px;
}

.iran-map-tip-cities {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.iran-map-tip-label {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.iran-map-tip-cities ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.iran-map-tip-cities li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin: 2px 0;
}

.iran-map-tip-cities strong {
    color: var(--saffron);
    font-variant-numeric: tabular-nums;
}

.iran-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 14px;
    justify-content: center;
}

.iran-map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.8rem;
}

.iran-map-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 232, 200, 0.18);
    flex: 0 0 auto;
}

.iran-map-swatch-high {
    background: rgba(232, 165, 75, 0.95);
}

.iran-map-swatch-low {
    background: rgba(232, 165, 75, 0.3);
}

.iran-map-swatch-none {
    background: rgba(111, 101, 92, 0.45);
}

/* ---------- تقویم بازی (تم‌پذیر) ---------- */
:root {
    --cal-win: var(--mint, #5ecf9a);
    --cal-loss: #e57373;
    --cal-plan: var(--saffron, #e8a54b);
    --cal-win-soft: rgba(94, 207, 154, 0.2);
    --cal-loss-soft: rgba(229, 115, 115, 0.2);
    --cal-plan-soft: rgba(232, 165, 75, 0.16);
    --cal-win-text: #9af0c4;
    --cal-loss-text: #ffb4b4;
    --cal-today-fg: #ffe2a8;
    --cal-today-tag-bg: rgba(255, 195, 106, 0.3);
    --cal-today-tag-fg: #fff0d0;
    --cal-cell-bg: var(--surface-faint);
    --cal-panel-bg: var(--surface-mid);
}

body.cal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.cal-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    background: var(--overlay-scrim);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.cal-overlay.is-open { opacity: 1; }

.cal-sheet {
    width: min(520px, 100%);
    max-height: min(92vh, 860px);
    overflow: auto;
    background: var(--profile-sheet-face);
    border: 1px solid var(--line);
    border-radius: 22px 22px 18px 18px;
    box-shadow: var(--shadow);
    color: var(--text);
    padding: 10px 14px 18px;
    transform: translateY(18px);
    transition: transform 0.22s ease;
    scrollbar-color: color-mix(in srgb, var(--saffron) 40%, transparent) transparent;
}

.cal-overlay.is-open .cal-sheet { transform: translateY(0); }

.cal-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 45%, transparent);
    margin: 2px auto 10px;
}

.cal-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.cal-head-text { flex: 1; min-width: 0; }
.cal-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--heading-strong, var(--text));
}
.cal-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.cal-countdown {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, color-mix(in srgb, var(--saffron) 28%, transparent), transparent 55%),
        linear-gradient(135deg, color-mix(in srgb, var(--mint) 14%, transparent), color-mix(in srgb, var(--saffron) 10%, transparent));
    border: 1px solid color-mix(in srgb, var(--saffron) 35%, transparent);
    text-align: center;
    color: var(--text);
}

.cal-cd-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 2px;
    font-weight: 600;
}
.cal-cd-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}
.cal-cd-time {
    margin-top: 6px;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--saffron-hot, var(--saffron));
    font-variant-numeric: tabular-nums;
}
.cal-cd-meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.cal-nav-label {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}
.cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-inset-soft);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}
.cal-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 10px;
    justify-content: center;
}
.cal-leg {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cal-leg::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.cal-leg.is-win::before { background: var(--cal-win); }
.cal-leg.is-loss::before { background: var(--cal-loss); }
.cal-leg.is-plan::before { background: var(--cal-plan); }

.cal-weekdays,
.cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.cal-weekdays {
    margin-bottom: 4px;
}
.cal-weekdays span {
    text-align: center;
    font-size: 0.74rem;
    color: var(--muted);
    font-weight: 700;
    padding: 4px 0;
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--cal-cell-bg);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.cal-cell.is-empty {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}
.cal-cell.is-today {
    border-color: color-mix(in srgb, var(--saffron) 75%, transparent);
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--saffron) 34%, transparent),
        color-mix(in srgb, var(--saffron) 14%, transparent)
    );
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--saffron-hot) 45%, transparent),
        0 6px 16px color-mix(in srgb, var(--saffron) 22%, transparent);
    color: var(--text);
}
.cal-cell.is-today .cal-day-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cal-today-fg);
}
.cal-today-tag {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--cal-today-tag-bg);
    color: var(--cal-today-tag-fg);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-cell.is-future {
    opacity: 0.48;
    background: color-mix(in srgb, var(--surface-faint) 70%, transparent);
    border-color: color-mix(in srgb, var(--line) 55%, transparent);
}
.cal-cell.is-future .cal-day-num {
    font-weight: 600;
    color: var(--muted);
}
.cal-cell.is-future.is-plan {
    opacity: 0.68;
}
.cal-cell.is-future.is-selected,
.cal-cell.is-today.is-selected {
    opacity: 1;
}
.cal-cell.is-selected {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 28%, transparent);
    transform: scale(1.03);
}
.cal-cell.is-today.is-selected {
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--saffron-hot) 65%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent),
        0 6px 16px color-mix(in srgb, var(--saffron) 26%, transparent);
}
.cal-cell.is-win {
    background: var(--cal-win-soft);
    border-color: color-mix(in srgb, var(--cal-win) 40%, transparent);
}
.cal-cell.is-loss {
    background: var(--cal-loss-soft);
    border-color: color-mix(in srgb, var(--cal-loss) 40%, transparent);
}
.cal-cell.is-mixed {
    background: linear-gradient(135deg, var(--cal-win-soft), var(--cal-loss-soft));
}
.cal-cell.is-plan {
    background: var(--cal-plan-soft);
    border-color: color-mix(in srgb, var(--cal-plan) 40%, transparent);
}
.cal-day-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}
.cal-dots {
    display: flex;
    gap: 3px;
    min-height: 6px;
    align-items: center;
    justify-content: center;
}
.cal-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: block;
}
.cal-dots i.is-win { background: var(--cal-win); }
.cal-dots i.is-loss { background: var(--cal-loss); }
.cal-dots i.is-plan { background: var(--cal-plan); }

.cal-yy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 12px;
    max-width: 100%;
}
.cal-yy i {
    display: block;
    width: var(--orb, 6px);
    height: var(--orb, 6px);
    max-width: 10px;
    max-height: 10px;
    min-width: 4px;
    min-height: 4px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}
.cal-yy i.is-win {
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--cal-win) 70%, white), var(--cal-win) 70%);
}
.cal-yy i.is-loss {
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--cal-loss) 70%, white), var(--cal-loss) 70%);
}

.cal-day-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--cal-panel-bg);
    color: var(--text);
}
.cal-day-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--heading-strong, var(--text));
}
.cal-section h4 {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
}
.cal-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}
.cal-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 700;
}
.cal-list li.is-win {
    background: var(--cal-win-soft);
    color: var(--cal-win-text);
    border: 1px solid color-mix(in srgb, var(--cal-win) 28%, transparent);
}
.cal-list li.is-loss {
    background: var(--cal-loss-soft);
    color: var(--cal-loss-text);
    border: 1px solid color-mix(in srgb, var(--cal-loss) 28%, transparent);
}
.cal-list-meta {
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0.9;
    color: inherit;
}

.cal-day-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}
.cal-day-summary > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--text) 6%, transparent);
    border: 1px solid var(--line);
    text-align: center;
}
.cal-day-summary strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--heading-strong, var(--text));
}
.cal-day-summary span {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 600;
}
.cal-day-summary > div.is-win strong { color: var(--cal-win-text, var(--cal-win)); }
.cal-day-summary > div.is-loss strong { color: var(--cal-loss-text, var(--cal-loss)); }

.cal-game {
    padding: 10px 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-mid, color-mix(in srgb, var(--text) 4%, transparent));
    margin-bottom: 10px;
}
.cal-game.is-win {
    border-color: color-mix(in srgb, var(--cal-win) 32%, transparent);
    background: var(--cal-win-soft);
}
.cal-game.is-loss {
    border-color: color-mix(in srgb, var(--cal-loss) 32%, transparent);
    background: var(--cal-loss-soft);
}
.cal-game-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.cal-game-result {
    font-size: 0.95rem;
    font-weight: 800;
}
.cal-game.is-win .cal-game-result { color: var(--cal-win-text, var(--cal-win)); }
.cal-game.is-loss .cal-game-result { color: var(--cal-loss-text, var(--cal-loss)); }
.cal-game-time {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}
.cal-game-meta {
    margin: 4px 0 8px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.cal-game-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.cal-game-kpis > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 4px;
    border-radius: 9px;
    background: color-mix(in srgb, #000 10%, transparent);
    text-align: center;
}
.cal-game-kpis strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--heading-strong, var(--text));
}
.cal-game-kpis span {
    font-size: 0.64rem;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.3;
}
.cal-game-sub {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    margin: 0 0 6px;
}
.cal-game-empty {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--muted);
}
.cal-game-words ul,
.cal-game-board ol {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}
.cal-game-words li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    font-size: 0.84rem;
}
.cal-game-words li:last-child { border-bottom: 0; }
.cal-game-words li strong {
    flex: 1;
    font-weight: 800;
}
.cal-game-words li.is-ok strong { color: var(--mint, #3dbf8a); }
.cal-game-words li.is-bad strong,
.cal-game-words li.is-rule strong {
    text-decoration: line-through;
    opacity: 0.78;
}
.cal-game-words .cal-word-pts {
    font-weight: 800;
    min-width: 2.4ch;
    color: var(--mint, #3dbf8a);
}
.cal-game-words em {
    font-style: normal;
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 700;
}
.cal-game-board li {
    display: grid;
    grid-template-columns: 1.6ch minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.cal-game-board li:last-child { border-bottom: 0; }
.cal-game-board li.is-me {
    font-weight: 800;
}
.cal-board-rank { color: var(--muted); font-weight: 800; }
.cal-board-name em {
    font-style: normal;
    font-size: 0.68rem;
    color: var(--saffron, #e8a54b);
    margin-right: 4px;
}
.cal-board-words { color: var(--muted); font-size: 0.72rem; }
.cal-board-score { font-weight: 800; }
@media (max-width: 520px) {
    .cal-day-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cal-game-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cal-card {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--saffron) 28%, transparent);
    background: color-mix(in srgb, var(--saffron) 10%, transparent);
    margin-bottom: 8px;
    color: var(--text);
}
.cal-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text);
}
.cal-card-meta, .cal-card-members {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}
.cal-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.cal-actions .btn { flex: 1 1 140px; }

.cal-form {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-inset-soft);
    color: var(--text);
}
.cal-form h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--heading-strong, var(--text));
}
.cal-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.cal-form-actions .btn { flex: 1; }

.cal-sheet .hint,
.cal-sheet .alert {
    color: var(--muted);
}

.btn-calendar {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--saffron) 45%, transparent);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--saffron) 24%, transparent),
        color-mix(in srgb, var(--saffron) 10%, transparent)
    );
    color: var(--chip-text, var(--text));
    font: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--saffron) 16%, transparent);
    white-space: nowrap;
}
.btn-calendar:hover {
    border-color: color-mix(in srgb, var(--saffron) 70%, transparent);
    transform: translateY(-1px);
}

.profile-prefs .btn-calendar {
    height: 40px;
}

.kapak-bug,
.kapak-fly {
    position: fixed;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    z-index: 70;
    cursor: pointer;
    pointer-events: auto;
    transform-origin: 50% 50%;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
}

.kapak-bug.is-roach {
    width: 78px;
    height: 46px;
    overflow: visible;
}

.kapak-bug.is-worm {
    width: 28px;
    height: 18px;
}

.kapak-bug.is-lizard {
    width: 44px;
    height: 96px;
    overflow: visible;
}

.kapak-bug.is-spider {
    width: 34px;
    height: 34px;
}

.kapak-bug.is-frog {
    width: 40px;
    height: 36px;
}

.kapak-bug svg,
.kapak-fly svg {
    display: block;
    width: 16px;
    height: 16px;
    margin: 3px;
    overflow: visible;
    filter:
        drop-shadow(0 0 1.2px rgba(255, 232, 186, 0.9))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

.kapak-bug.is-roach svg,
.kapak-bug.is-lizard svg { display: none; }

.kapak-roach {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.kapak-roach-gait {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
    will-change: transform;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.kapak-roach-part {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}

.kapak-roach-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* عکس افقی: سر سمت چپ — بدنه فقط تنه؛ پاها بیرون می‌مانند */
.kapak-roach-part.is-body {
    z-index: 6;
    /* بیضی قبلی پاهای عقب را می‌پوشاند — فقط بال/سینه */
    clip-path: polygon(
        24% 44%, 30% 36%, 48% 33%, 72% 34%, 88% 42%, 93% 50%,
        88% 58%, 72% 66%, 48% 67%, 30% 64%, 24% 56%
    );
}

.kapak-roach-part.is-ant-l {
    z-index: 4;
    clip-path: polygon(0% 0%, 32% 14%, 36% 34%, 18% 38%, 0% 20%);
    transform-origin: 30% 36%;
}

.kapak-roach-part.is-ant-r {
    z-index: 4;
    clip-path: polygon(0% 80%, 18% 62%, 36% 66%, 32% 86%, 0% 100%);
    transform-origin: 30% 64%;
}

/* بالا / پایین؛ جلو نزدیک سر (چپ)، عقب نزدیک دم (راست) */
.kapak-roach-part.is-leg-lf {
    z-index: 3;
    clip-path: polygon(2% 0%, 36% 0%, 40% 34%, 18% 40%, 0% 22%);
    transform-origin: 36% 32%;
}

.kapak-roach-part.is-leg-lm {
    z-index: 3;
    clip-path: polygon(30% 0%, 62% 0%, 64% 32%, 40% 38%, 26% 14%);
    transform-origin: 48% 32%;
}

.kapak-roach-part.is-leg-lb {
    z-index: 3;
    clip-path: polygon(50% 0%, 96% 2%, 100% 32%, 72% 38%, 48% 18%);
    transform-origin: 62% 34%;
}

.kapak-roach-part.is-leg-rf {
    z-index: 3;
    clip-path: polygon(0% 78%, 18% 60%, 40% 66%, 36% 100%, 2% 100%);
    transform-origin: 36% 68%;
}

.kapak-roach-part.is-leg-rm {
    z-index: 3;
    clip-path: polygon(26% 86%, 40% 62%, 64% 68%, 62% 100%, 30% 100%);
    transform-origin: 48% 68%;
}

.kapak-roach-part.is-leg-rb {
    z-index: 3;
    clip-path: polygon(48% 82%, 72% 62%, 100% 68%, 96% 98%, 50% 100%);
    transform-origin: 62% 66%;
}

/* سه‌پایه: هر شش پا انیمیشن جدا؛ عقب‌ها دامنه بیشتر */
.kapak-bug.is-roach.is-walking .kapak-roach-gait {
    animation: kapak-roach-body-bob var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-lf {
    animation: kapak-roach-swing-a var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-lm {
    animation: kapak-roach-swing-b var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-lb {
    animation: kapak-roach-swing-a var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-rf {
    animation: kapak-roach-swing-b var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-rm {
    animation: kapak-roach-swing-a var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-leg-rb {
    animation: kapak-roach-swing-b var(--roach-walk-ms, 220ms) ease-in-out infinite;
}

.kapak-bug.is-roach.is-walking .is-ant-l {
    animation: kapak-roach-ant-l calc(var(--roach-walk-ms, 220ms) * 1.4) ease-in-out infinite alternate;
}

.kapak-bug.is-roach.is-walking .is-ant-r {
    animation: kapak-roach-ant-r calc(var(--roach-walk-ms, 220ms) * 1.55) ease-in-out infinite alternate;
}

.kapak-bug.is-roach.is-scurry .kapak-roach-gait,
.kapak-bug.is-roach.is-scurry .is-leg-lf,
.kapak-bug.is-roach.is-scurry .is-leg-lm,
.kapak-bug.is-roach.is-scurry .is-leg-lb,
.kapak-bug.is-roach.is-scurry .is-leg-rf,
.kapak-bug.is-roach.is-scurry .is-leg-rm,
.kapak-bug.is-roach.is-scurry .is-leg-rb {
    animation-timing-function: cubic-bezier(0.28, 0.02, 0.52, 0.98);
}

.kapak-bug.is-roach:not(.is-walking) .kapak-roach-gait,
.kapak-bug.is-roach.is-trapped .kapak-roach-gait,
.kapak-bug.is-roach.is-on-brain .kapak-roach-gait {
    animation: kapak-roach-idle 1.2s ease-in-out infinite;
}

.kapak-bug.is-roach:not(.is-walking) .kapak-roach-part,
.kapak-bug.is-roach.is-trapped .kapak-roach-part,
.kapak-bug.is-roach.is-on-brain .kapak-roach-part {
    animation: none !important;
}

.kapak-bug.is-roach:not(.is-walking) .is-ant-l,
.kapak-bug.is-roach.is-on-brain .is-ant-l {
    animation: kapak-roach-ant-l 1.55s ease-in-out infinite alternate !important;
}

.kapak-bug.is-roach:not(.is-walking) .is-ant-r,
.kapak-bug.is-roach.is-on-brain .is-ant-r {
    animation: kapak-roach-ant-r 1.8s ease-in-out infinite alternate !important;
}

@keyframes kapak-roach-body-bob {
    0%, 100% {
        transform: translate3d(0, 0.4px, 0) rotate(-1.4deg) scale(1, 0.985);
    }
    25% {
        transform: translate3d(-0.8px, -0.8px, 0) rotate(0.6deg) scale(1.02, 0.97);
    }
    50% {
        transform: translate3d(0, 0.5px, 0) rotate(1.4deg) scale(1, 0.99);
    }
    75% {
        transform: translate3d(0.7px, -0.7px, 0) rotate(-0.5deg) scale(1.015, 0.975);
    }
}

@keyframes kapak-roach-swing-a {
    0%, 100% { transform: rotate(-26deg) translate(0, 0); }
    50% { transform: rotate(24deg) translate(0.5px, -1.5px); }
}

@keyframes kapak-roach-swing-b {
    0%, 100% { transform: rotate(26deg) translate(0, 0); }
    50% { transform: rotate(-24deg) translate(-0.5px, 1.5px); }
}

@keyframes kapak-roach-ant-l {
    from { transform: rotate(-14deg) translateX(-1px); }
    to { transform: rotate(12deg) translateX(1px); }
}

@keyframes kapak-roach-ant-r {
    from { transform: rotate(14deg) translateX(-1px); }
    to { transform: rotate(-12deg) translateX(1px); }
}

@keyframes kapak-roach-idle {
    0%, 100% { transform: rotate(-0.8deg) translateY(0); }
    50% { transform: rotate(0.8deg) translateY(0.4px); }
}

.kapak-bug.is-worm svg {
    width: 22px;
    height: 12px;
}

.kapak-bug.is-lizard svg {
    display: none;
}

.kapak-lizard {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.kapak-lizard-gait {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: 50% 28%;
    will-change: transform;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.kapak-lizard-part {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}

.kapak-lizard-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* عکس عمودی: سر بالا، دم پایین */
.kapak-lizard-part.is-body {
    z-index: 6;
    clip-path: polygon(
        38% 2%, 62% 2%, 68% 14%, 66% 28%, 62% 42%,
        58% 48%, 42% 48%, 38% 42%, 34% 28%, 32% 14%
    );
}

.kapak-lizard-part.is-leg-fl {
    z-index: 3;
    clip-path: polygon(2% 8%, 36% 10%, 40% 28%, 18% 34%, 0% 22%);
    transform-origin: 38% 22%;
}

.kapak-lizard-part.is-leg-fr {
    z-index: 3;
    clip-path: polygon(64% 10%, 98% 8%, 100% 22%, 82% 34%, 60% 28%);
    transform-origin: 62% 22%;
}

.kapak-lizard-part.is-leg-bl {
    z-index: 3;
    clip-path: polygon(0% 32%, 34% 34%, 40% 52%, 16% 58%, 0% 48%);
    transform-origin: 36% 42%;
}

.kapak-lizard-part.is-leg-br {
    z-index: 3;
    clip-path: polygon(66% 34%, 100% 32%, 100% 48%, 84% 58%, 60% 52%);
    transform-origin: 64% 42%;
}

.kapak-lizard-part.is-tail {
    z-index: 2;
    clip-path: polygon(42% 46%, 58% 46%, 62% 62%, 58% 88%, 50% 100%, 42% 88%, 38% 62%);
    transform-origin: 50% 48%;
}

.kapak-bug.is-lizard.is-walking .kapak-lizard-gait {
    animation: kapak-lizard-body-bob var(--lizard-walk-ms, 280ms) ease-in-out infinite;
}

.kapak-bug.is-lizard.is-walking .is-leg-fl,
.kapak-bug.is-lizard.is-walking .is-leg-br {
    animation: kapak-lizard-leg-a var(--lizard-walk-ms, 280ms) ease-in-out infinite;
}

.kapak-bug.is-lizard.is-walking .is-leg-fr,
.kapak-bug.is-lizard.is-walking .is-leg-bl {
    animation: kapak-lizard-leg-b var(--lizard-walk-ms, 280ms) ease-in-out infinite;
}

.kapak-bug.is-lizard.is-walking .is-tail {
    animation: kapak-lizard-tail calc(var(--lizard-walk-ms, 280ms) * 1.15) ease-in-out infinite;
}

.kapak-bug.is-lizard:not(.is-walking) .kapak-lizard-gait,
.kapak-bug.is-lizard.is-trapped .kapak-lizard-gait,
.kapak-bug.is-lizard.is-on-brain .kapak-lizard-gait {
    animation: kapak-lizard-idle 1.4s ease-in-out infinite;
}

.kapak-bug.is-lizard:not(.is-walking) .kapak-lizard-part,
.kapak-bug.is-lizard.is-trapped .kapak-lizard-part,
.kapak-bug.is-lizard.is-on-brain .kapak-lizard-part {
    animation: none !important;
}

.kapak-bug.is-lizard:not(.is-walking) .is-tail,
.kapak-bug.is-lizard.is-on-brain .is-tail {
    animation: kapak-lizard-tail 2.2s ease-in-out infinite !important;
}

@keyframes kapak-lizard-body-bob {
    0%, 100% { transform: translate3d(0, 0.3px, 0) rotate(-1deg); }
    50% { transform: translate3d(0.5px, -0.8px, 0) rotate(1deg); }
}

@keyframes kapak-lizard-leg-a {
    0%, 100% { transform: rotate(-18deg); }
    50% { transform: rotate(20deg) translateY(-1px); }
}

@keyframes kapak-lizard-leg-b {
    0%, 100% { transform: rotate(18deg); }
    50% { transform: rotate(-20deg) translateY(1px); }
}

@keyframes kapak-lizard-tail {
    0%, 100% { transform: rotate(-8deg) skewX(-2deg); }
    33% { transform: rotate(6deg) skewX(2deg); }
    66% { transform: rotate(-4deg) skewX(-1deg); }
}

@keyframes kapak-lizard-idle {
    0%, 100% { transform: rotate(-0.6deg); }
    50% { transform: rotate(0.6deg); }
}

.kapak-bug.is-spider svg {
    width: 28px;
    height: 28px;
    margin: 3px;
}

.kapak-bug.is-frog svg {
    width: 34px;
    height: 30px;
    margin: 3px;
}

.kapak-fly-wing {
    transform-box: fill-box;
}

.kapak-fly-wing.is-left {
    transform-origin: 100% 70%;
    animation: kapak-fly-flap-l 0.07s ease-in-out infinite alternate;
}

.kapak-fly-wing.is-right {
    transform-origin: 0% 70%;
    animation: kapak-fly-flap-r 0.07s ease-in-out infinite alternate;
}

.kapak-bug.is-on-brain {
    pointer-events: none !important;
    cursor: default;
}

.kapak-bug.is-on-brain .kapak-fly-wing.is-left {
    animation: none;
    transform: rotate(18deg) scaleY(0.12) translate(1px, 3px);
}

.kapak-bug.is-on-brain .kapak-fly-wing.is-right {
    animation: none;
    transform: rotate(-18deg) scaleY(0.12) translate(-1px, 3px);
}

.kapak-bug.is-crawling .kapak-bug-leg-l {
    transform-box: fill-box;
    transform-origin: 100% 50%;
    animation: kapak-bug-step-l 0.16s ease-in-out infinite alternate;
}

.kapak-bug.is-crawling .kapak-bug-leg-r {
    transform-box: fill-box;
    transform-origin: 0% 50%;
    animation: kapak-bug-step-r 0.16s ease-in-out infinite alternate;
}

.kapak-bug.is-worm.is-crawling .kapak-worm-body {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: kapak-worm-wiggle 0.28s ease-in-out infinite alternate;
}

@keyframes kapak-fly-flap-l {
    from { transform: rotate(-8deg) scaleY(1); }
    to { transform: rotate(-50deg) scaleY(0.5); }
}

@keyframes kapak-fly-flap-r {
    from { transform: rotate(8deg) scaleY(1); }
    to { transform: rotate(50deg) scaleY(0.5); }
}

@keyframes kapak-bug-step-l {
    from { transform: rotate(-8deg); }
    to { transform: rotate(18deg); }
}

@keyframes kapak-bug-step-r {
    from { transform: rotate(8deg); }
    to { transform: rotate(-18deg); }
}

@keyframes kapak-worm-wiggle {
    from { transform: scaleX(1) rotate(-4deg); }
    to { transform: scaleX(0.92) rotate(4deg); }
}

.kapak-fly-plus {
    position: fixed;
    z-index: 80;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(42, 28, 12, 0.92), rgba(22, 14, 8, 0.88));
    border: 1px solid rgba(232, 165, 75, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    font-size: 0.72rem;
    font-weight: 800;
    color: #f0c878;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    animation: kapak-fly-plus-up 1.35s ease-out forwards;
}

.kapak-fly-plus-val {
    font-size: 0.95rem;
    font-weight: 900;
    color: #ffd48a;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.kapak-fly-plus-kind {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 236, 200, 0.85);
}

.kapak-fly-plus-note {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 210, 180, 0.9);
}

.kapak-fly-plus.is-hint {
    border-color: rgba(255, 180, 150, 0.4);
    color: #ffe1d8;
}

.kapak-fly-plus.is-zero .kapak-fly-plus-val {
    color: rgba(220, 200, 170, 0.75);
}

@keyframes kapak-fly-plus-up {
    0% { opacity: 0; transform: translateY(6px) scale(0.85); }
    12% { opacity: 1; transform: translateY(0) scale(1); }
    70% { opacity: 1; transform: translateY(-18px) scale(1); }
    100% { opacity: 0; transform: translateY(-36px) scale(0.96); }
}

.kapak-bug.is-trapped {
    filter: brightness(0.85);
    cursor: pointer;
}

.kapak-spider-web {
    position: fixed;
    z-index: 65;
    pointer-events: none;
    opacity: 0.85;
    animation: kapak-web-in 0.45s ease-out;
}

.kapak-spider-web svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.25));
}

@keyframes kapak-web-in {
    from { opacity: 0; transform: scale(0.35); }
    to { opacity: 0.85; transform: scale(1); }
}

.kapak-bug-gore {
    position: fixed;
    z-index: 72;
    width: 0;
    height: 0;
    pointer-events: none;
}

.kapak-bug-pool {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--pool-w, 34px);
    height: var(--pool-h, 22px);
    transform: translate(-50%, -50%) rotate(var(--pool-rot, -12deg)) scale(0.35);
    border-radius: 68% 32% 58% 42% / 48% 62% 38% 52%;
    background:
        radial-gradient(ellipse at 42% 38%, rgba(130, 16, 20, 0.92) 0%, rgba(78, 8, 12, 0.82) 38%, rgba(42, 4, 8, 0.45) 68%, transparent 78%),
        radial-gradient(ellipse at 68% 62%, rgba(95, 10, 14, 0.7) 0%, transparent 55%);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.35),
        inset 0 -2px 4px rgba(20, 0, 0, 0.35),
        inset 1px 1px 2px rgba(160, 40, 40, 0.18);
    filter: blur(0.35px);
    animation:
        kapak-pool-settle 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) forwards,
        kapak-smear-fade 5s ease-out forwards;
}

.kapak-bug-pool.is-secondary {
    opacity: 0.85;
    transform: translate(calc(-50% + var(--dx, 8px)), calc(-50% + var(--dy, 6px))) rotate(var(--pool-rot, 20deg)) scale(0.25);
    border-radius: 42% 58% 48% 52% / 60% 40% 55% 45%;
    filter: blur(0.55px);
}

/* له‌شدن واقعی سوسک: شیره سفید/کرم به‌جای خون قرمز */
.kapak-bug-gore.is-roach .kapak-bug-pool {
    background:
        radial-gradient(ellipse at 42% 38%, rgba(255, 252, 245, 0.96) 0%, rgba(242, 232, 205, 0.9) 36%, rgba(210, 200, 170, 0.5) 68%, transparent 80%),
        radial-gradient(ellipse at 68% 62%, rgba(235, 225, 195, 0.75) 0%, transparent 55%);
    box-shadow:
        0 1px 3px rgba(40, 35, 20, 0.28),
        inset 0 -2px 4px rgba(120, 110, 80, 0.22),
        inset 1px 1px 2px rgba(255, 255, 255, 0.35);
}

.kapak-bug-gore.is-roach .kapak-bug-blood {
    box-shadow: 0 0.5px 1.5px rgba(90, 80, 50, 0.28);
}

.kapak-bug-gore.is-roach .kapak-bug-gore-photo {
    filter: saturate(0.55) brightness(0.85) contrast(1.08) sepia(0.12);
}

.kapak-bug-blood {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--sz, 6px);
    height: var(--sz, 6px);
    border-radius: var(--br, 50% 40% 55% 45%);
    transform: translate(-50%, -50%);
    animation: kapak-blood-spatter 0.42s cubic-bezier(0.15, 0.75, 0.25, 1) forwards;
    animation-delay: var(--delay, 0s);
    opacity: 0.9;
    filter: blur(0.25px);
    box-shadow: 0 0.5px 1.5px rgba(20, 0, 0, 0.35);
}

.kapak-bug-blood.is-streak {
    width: calc(var(--sz, 6px) * 0.7);
    height: calc(var(--sz, 6px) * 2.4);
    border-radius: 40% 60% 55% 45% / 20% 25% 75% 80%;
    filter: blur(0.4px);
}

.kapak-bug-blood.is-drip {
    width: calc(var(--sz, 6px) * 0.85);
    height: calc(var(--sz, 6px) * 1.7);
    border-radius: 45% 55% 50% 50% / 30% 30% 70% 70%;
    animation-name: kapak-blood-drip;
    animation-duration: 0.55s;
}

.kapak-bug-blood.is-mist {
    filter: blur(1.1px);
    opacity: 0.55;
    width: calc(var(--sz, 6px) * 1.4);
    height: calc(var(--sz, 6px) * 1.1);
}

.kapak-bug-part {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--pw, 9px);
    height: var(--ph, 6px);
    transform: translate(-50%, -50%);
    animation: kapak-part-fling 0.48s ease-out forwards;
}

.kapak-bug-part i {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 55% 35% 60% 40% / 45% 55% 40% 60%;
    background: #4a2814;
    transform: rotate(var(--rot, 0deg));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    filter: blur(0.15px);
}

.kapak-bug-gore-photo {
    position: absolute;
    left: -30px;
    top: -16px;
    width: 60px;
    height: 34px;
    object-fit: contain;
    transform: rotate(var(--smash-rot, 25deg)) scaleY(0.4) scaleX(1.1);
    filter: saturate(0.65) brightness(0.7) contrast(1.05);
    opacity: 0.88;
    animation: kapak-smear-fade 5s ease-out forwards;
}

.kapak-bug-gore-photo.is-lizard {
    left: -16px;
    top: -36px;
    width: 34px;
    height: 72px;
    transform: rotate(var(--smash-rot, 18deg)) scaleY(0.42) scaleX(1.05);
}

@keyframes kapak-pool-settle {
    from { transform: translate(-50%, -50%) rotate(var(--pool-rot, -12deg)) scale(0.2); opacity: 0.4; }
    to { transform: translate(-50%, -50%) rotate(var(--pool-rot, -12deg)) scale(1); opacity: 0.95; }
}

@keyframes kapak-blood-spatter {
    from {
        transform: translate(-50%, -50%) scale(0.15);
        opacity: 1;
    }
    70% {
        opacity: 0.92;
    }
    to {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1);
        opacity: 0.82;
    }
}

@keyframes kapak-blood-drip {
    from {
        transform: translate(-50%, -50%) scale(0.2, 0.4);
        opacity: 1;
    }
    to {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 8px)) scale(0.85, 1.35);
        opacity: 0.8;
    }
}

@keyframes kapak-part-fling {
    from { transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot, 40deg)); opacity: 0.75; }
}

@keyframes kapak-smear-fade {
    0%, 65% { opacity: 0.92; }
    100% { opacity: 0; }
}




