/* IRANYekanXFaNum Font Faces */
@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 100;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Thin.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Thin.woff2') format('woff2');		
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 200;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-UltraLight.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-UltraLight.woff2') format('woff2');	
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 300;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Light.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Light.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 500;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Medium.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Medium.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 600;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-DemiBold.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-DemiBold.woff2') format('woff2');	 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 800;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-ExtraBold.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-ExtraBold.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 900;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Black.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Black.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 950;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-ExtraBlack.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-ExtraBlack.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: 1000;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Heavy.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Heavy.woff2') format('woff2');		 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: bold;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Bold.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Bold.woff2') format('woff2');	 
}

@font-face {
	font-family: IRANYekanXFaNum;
	font-style: normal;
	font-weight: normal;
	src: url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff/IRANYekanXFaNum-Regular.woff') format('woff'),   
	url('../fonts/IRANYekanX/Farsi numerals/Webfonts/Woff2/IRANYekanXFaNum-Regular.woff2') format('woff2');	
}

:root {
    --font-main: 'IRANYekanXFaNum', sans-serif;
    /* Aurora / obsidian — عمق سرد + فیروزه‌ای به‌جای کهربایی */
    --md-primary: #2dd4bf;
    --md-on-primary: #042f2e;
    --md-surface: #070b12;
    --md-on-surface: #e8eef6;
    --md-on-surface-variant: #94a3b8;
    --md-surface-variant: #111827;
    --md-outline: rgba(255, 255, 255, 0.1);
    --md-secondary: #64748b;
    --md-error: #f43f5e;
    --md-success: #22c55e;
    --md-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
    --md-scrim: rgba(2, 6, 14, 0.58);
    --md-modal-surface: #0c1220;
    --md-elevation-modal: 0 20px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
    --md-elevation-modal-day: 0 18px 48px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.06);

    --accent: var(--md-primary);
    --accent-deep: #0d9488;
    --accent-bright: #5eead4;
    --accent-muted-on-light: #0f766e;
    --mafia-color: #fb7185;
    --citizen-color: #38bdf8;
    --indep-color: #c084fc;

    /* تم شب */
    --bg: var(--md-surface);
    --text: var(--md-on-surface);
    --card-bg: var(--md-surface-variant);
    --row-bg: #151f2e;
    --header-bg: rgba(7, 11, 18, 0.92);
    --bottom-nav-bg: rgba(10, 15, 24, 0.94);
    --btn-secondary: var(--md-secondary);
    --modal-bg: var(--md-surface-variant);
    --border-color: var(--md-outline);
    --table-row-even: #151f2e;
    --table-row-odd: #0f1624;
    --ui-radius-sm: 10px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 20px;
    --ui-radius-xl: 28px;
}

/* تم روز */
body.day-mode {
    --md-surface: #f4f6fb;
    --md-on-surface: #0f172a;
    --md-on-surface-variant: #475569;
    --md-surface-variant: #ffffff;
    --md-outline: rgba(15, 23, 42, 0.09);
    --md-scrim: rgba(15, 23, 42, 0.42);
    --md-modal-surface: #ffffff;
    --bg: var(--md-surface);
    --text: var(--md-on-surface);
    --card-bg: var(--md-surface-variant);
    --row-bg: #e8edf5;
    --header-bg: rgba(255, 255, 255, 0.94);
    --bottom-nav-bg: rgba(255, 255, 255, 0.96);
    --btn-secondary: #cbd5e1;
    --modal-bg: var(--md-surface-variant);
    --border-color: var(--md-outline);
    --table-row-even: #eef2f9;
    --table-row-odd: #ffffff;
    background-image:
        radial-gradient(110% 70% at 100% 0%, color-mix(in srgb, var(--accent) 11%, transparent) 0%, transparent 58%);
    background-attachment: fixed;
}

body.mafia-win { --bg: #3b0a14; --text: #ffe4e6; background-image: none; }
body.city-win { --bg: #052e26; --text: #ccfbf1; background-image: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    margin: 0;
    padding: 0;
    width: 100%;
    /* برای اندروید در حالت fullscreen - بدون حاشیه */
    -webkit-overflow-scrolling: touch;
    /* حذف حاشیه‌های پیش‌فرض مرورگر */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(130% 90% at 100% -20%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
        radial-gradient(80% 60% at -10% 110%, color-mix(in srgb, var(--citizen-color) 14%, transparent) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text); font-family: var(--font-main);
    margin: 0; padding: 0; text-align: center; user-select: none;
    /* Safe area insets for fullscreen mode (iOS notch and Android navigation bar) */
    padding-top: env(safe-area-inset-top, 0px); /* فقط safe area در حالت پیش‌فرض */
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    transition: background-color 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* برای iOS Safari */
    /* برای اندروید در حالت fullscreen - بدون حاشیه */
    position: relative;
}

/* وقتی هدر چسبان بازی فعال است، فضای لازم بالای صفحه اضافه شود */
body.has-sticky-header {
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
}
body.has-sticky-header.day-mode {
    padding-top: calc(0px + env(safe-area-inset-top, 0px)); /* padding-top فقط برای safe area - فاصله در container تنظیم می‌شود */
}

button, input, select { font-family: var(--font-main) !important; }

/* HEADER */
.sticky-header {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    min-height: 60px;
    background: var(--header-bg); 
    backdrop-filter: blur(20px);
    z-index: 100; 
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
    padding: 10px 16px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Safe area insets for fullscreen mode */
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    display: flex; 
    flex-direction: column; 
    gap: 6px;
    transition: all 0.25s ease;
}
body:not(.day-mode) .sticky-header {
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}
body.day-mode .sticky-header {
    padding: 14px 18px 12px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-left: calc(18px + env(safe-area-inset-left, 0px));
    padding-right: calc(18px + env(safe-area-inset-right, 0px));
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.app-bar-brand {
    font-weight: 900;
    color: var(--accent);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: right;
}
.app-bar-version {
    font-size: 10px;
    opacity: 0.62;
    font-weight: 700;
}
body.day-mode .header-top {
    margin-bottom: 10px;
}
.app-title {
    font-weight: 900;
    color: var(--accent);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phase-badge-container {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 800;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    transition: all 0.25s ease;
}
.phase-badge-day {
    background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-muted-on-light); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
body.day-mode .phase-badge-day {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 15%, transparent);
}
body.day-mode .phase-badge-day:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 25%, transparent);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.phase-badge-night {
    background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.4);
}
body:not(.day-mode) .phase-badge-night {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    transition: all 0.25s ease;
}
body:not(.day-mode) .phase-badge-night:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
}

.header-stats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}
.stat-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 9px 12px; /* کمی ارتفاع بیشتر نسبت به قبل */
    border-radius: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--md-shadow);
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: transparent;
    border-style: solid;
}
.stat-badge .stat-label {
    flex: 1;
    text-align: center;
}
.stat-badge .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.stat-badge i {
    pointer-events: none;
}
.day-mode .header-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.day-mode .header-stats.status-count-1 {
    grid-template-columns: 1fr;
}
.day-mode .header-stats.status-count-2 {
    grid-template-columns: repeat(2, 1fr);
}
.day-mode .header-stats.status-count-3 {
    grid-template-columns: repeat(3, 1fr);
}
.day-mode .header-stats.status-count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}
.day-mode .stat-badge {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 14px;
    border-radius: 14px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.day-mode .stat-badge::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.day-mode .stat-badge:hover::before {
    opacity: 1;
}
.day-mode .stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.day-mode .stat-badge .stat-label {
    font-weight: 800;
    font-size: 14px;
}
.day-mode .stat-badge .stat-icon {
    font-size: 12px;
}
.stat-badge.bg-alive .stat-label { color: white !important; }
.stat-badge.bg-alive .stat-icon { color: white !important; }
.stat-badge.bg-alive i { color: white !important; }
.stat-badge.bg-vote .stat-label { color: white !important; }
.stat-badge.bg-vote .stat-icon { color: white !important; }
.stat-badge.bg-vote i { color: white !important; }
body.day-mode .stat-badge.bg-alive .stat-label { color: white !important; }
body.day-mode .stat-badge.bg-alive .stat-icon { color: white !important; }
body.day-mode .stat-badge.bg-alive i { color: white !important; }
body.day-mode .stat-badge.bg-vote .stat-label { color: white !important; }
body.day-mode .stat-badge.bg-vote .stat-icon { color: white !important; }
body.day-mode .stat-badge.bg-vote i { color: white !important; }
.bg-alive { background: #3b82f6; color: white !important; }
.bg-alive .stat-label { color: white !important; }
.bg-alive .stat-icon { color: white !important; }
.bg-alive i { color: white !important; }
body.day-mode .bg-alive {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: white !important;
}
body.day-mode .bg-alive .stat-label { color: white !important; }
body.day-mode .bg-alive .stat-icon { color: white !important; }
body.day-mode .bg-alive i { color: white !important; }
.bg-vote { background: #ef4444; color: white !important; }
.bg-vote .stat-label { color: white !important; }
.bg-vote .stat-icon { color: white !important; }
.bg-vote i { color: white !important; }
body.day-mode .bg-vote {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(239, 68, 68, 0.3);
    color: white !important;
}
body.day-mode .bg-vote .stat-label { color: white !important; }
body.day-mode .bg-vote .stat-icon { color: white !important; }
body.day-mode .bg-vote i { color: white !important; }
#alive-badge { color: white !important; }
#alive-badge .stat-label { color: white !important; }
#alive-badge .stat-icon { color: white !important; }
#alive-badge i { color: white !important; }
#vote-badge { color: white !important; }
#vote-badge .stat-label { color: white !important; }
#vote-badge .stat-icon { color: white !important; }
#vote-badge i { color: white !important; }
body.day-mode #alive-badge { color: white !important; }
body.day-mode #alive-badge .stat-label { color: white !important; }
body.day-mode #alive-badge .stat-icon { color: white !important; }
body.day-mode #alive-badge i { color: white !important; }
body.day-mode #vote-badge { color: white !important; }
body.day-mode #vote-badge .stat-label { color: white !important; }
body.day-mode #vote-badge .stat-icon { color: white !important; }
body.day-mode #vote-badge i { color: white !important; }
.bg-inquiry { background: #10b981; color: white; }
body.day-mode .bg-inquiry {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.3);
    color: white;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 74px;
    background: var(--bottom-nav-bg); 
    backdrop-filter: blur(20px);
    z-index: 100; 
    border-top: 2px solid rgba(99, 102, 241, 0.2);
    display: flex; 
    align-items: center; 
    justify-content: space-around;
    padding: 0 10px; 
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    /* Safe area insets for fullscreen mode */
    padding-bottom: calc(0px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
    height: calc(74px + env(safe-area-inset-bottom, 0px));
    transition: all 0.25s ease;
}
body:not(.day-mode) .bottom-nav {
    border-top: 2px solid rgba(99, 102, 241, 0.3);
}
body.day-mode .bottom-nav {
    height: 80px;
    height: calc(80px + env(safe-area-inset-bottom, 0px));
    padding: 0 12px;
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.phase-fab {
    width: 62px; height: 62px; border-radius: 18px;
    background: var(--accent); border: 5px solid var(--bg);
    display: flex; align-items: center; justify-content: center; font-size: 26px;
    box-shadow: var(--md-shadow); transform: translateY(-24px);
    color: var(--md-on-primary); cursor: pointer; transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
}
body.day-mode .phase-fab {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    font-size: 28px;
    transform: translateY(-28px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
body.day-mode .phase-fab:hover {
    transform: translateY(-30px) scale(1.05);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
body.day-mode .phase-fab i {
    animation: gentleRotate 8s linear infinite;
}
.phase-fab.night i {
    animation: gentleRotate 8s linear infinite;
}
@keyframes gentleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.phase-fab.night { 
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #e0e7ff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transition: all 0.25s ease;
}
body:not(.day-mode) .phase-fab.night:hover {
    transform: translateY(-30px) scale(1.05);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}
.nav-btn {
    background: transparent; border: none; color: var(--text); opacity: 0.7;
    display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; width: 70px;
    transition: color 0.2s ease, opacity 0.2s ease;
}
body.day-mode .nav-btn {
    font-size: 13px;
    font-weight: 800;
    opacity: 0.7;
    transition: all 0.2s ease;
}
body.day-mode .nav-btn:hover {
    opacity: 1;
    color: var(--accent);
}
.nav-btn.active { opacity: 1; color: var(--accent); }
.nav-btn i { font-size: 22px; font-style: normal; }

/* UI ELEMENTS */
.container { padding: 12px 16px; max-width: 620px; margin: 0 auto; width: 100%; box-sizing: border-box; }
body.has-sticky-header.day-mode .container,
body.day-mode .container {
    padding-top: 150px !important;
}
.card { 
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%); 
    padding: 20px; 
    margin-bottom: 16px; 
    border-radius: 18px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1) inset; 
    border: 2px solid rgba(99, 102, 241, 0.2); 
    box-sizing: border-box;
    transition: all 0.25s ease;
}
body:not(.day-mode) .card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2) inset;
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}
body.day-mode .card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--md-shadow);
}

.intro-hero {
    text-align: center; padding: 20px 14px; margin-bottom: 40px;
}
.intro-hero h1 { margin: 6px 0 10px 0; font-size: 32px; font-weight: 900; color: var(--accent); text-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.intro-hero p { margin: 8px 0 0 0; opacity: 0.75; font-size: 14px; }
.hero-subtitle { font-size: 15px; opacity: 0.8; font-weight: 600; margin-bottom: 10px; }
.app-logo { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 20px; background: var(--row-bg); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); border: 1px solid var(--border-color); transition: transform 0.3s ease; }
.app-logo:hover { transform: scale(1.05); }
.app-logo img { max-width: 80%; max-height: 80%; border-radius: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.section-header h2 { margin: 6px 0 4px 0; font-size: 22px; }
.section-subtitle { margin: 0; opacity: 0.7; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.label-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; border: 1px solid var(--border-color); background: rgba(255,255,255,0.04); color: var(--accent); }
.count-card .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.count-card h3 { margin: 0; font-size: 26px; font-weight: 800; }
.label-sm { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; margin-bottom: 8px; }
.hint-pill { padding: 8px 16px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent) 0%, color-mix(in srgb, var(--accent) 15%, transparent) 100%); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 12px; font-weight: 700; color: var(--accent-bright); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent); }

.btn { width: 100%; padding: 12px; border-radius: 14px; font-size: 15px; border: none; font-weight: 800; cursor: pointer; margin-bottom: 8px; color: var(--md-on-primary); display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--md-shadow); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
body.day-mode .btn {
    border-radius: 14px;
    transition: all 0.25s ease;
}
body.day-mode .btn:active {
    transform: translateY(0) scale(0.98);
}
.btn-blue { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); color: #0f172a; box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-blue:hover { background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%); box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-2px); }
.btn-red { background: var(--md-error); color: #fff; }
body.day-mode .btn-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
body.day-mode .btn-red:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}
.btn-gray { background: linear-gradient(135deg, rgba(71, 85, 105, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.1); }
.btn-gray:hover { background: linear-gradient(135deg, rgba(71, 85, 105, 1) 0%, rgba(51, 65, 85, 1) 100%); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4); }
body.day-mode .btn-gray {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.12) 0%, rgba(203, 213, 225, 0.08) 100%);
    color: #475569;
    border: 2px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
body.day-mode .btn-gray:hover {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.2) 0%, rgba(203, 213, 225, 0.15) 100%);
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn-yellow { background: var(--accent); color: var(--md-on-primary); }
.btn-purple { background: #7c3aed; color: #fff; }
.btn-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3); }
.btn-green:hover { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); box-shadow: 0 8px 32px rgba(16, 185, 129, 0.5); transform: translateY(-2px); }
.btn-small { padding: 6px 12px; font-size: 12px; width: auto; margin: 0 2px; border-radius: 12px; box-shadow: none; }

.btn-action-small {
    padding: 12px 12px; font-size: 13px; border-radius: 12px; border: none; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--md-shadow); color: white;
    flex: 1; min-width: 0; /* عرض یکسان برای تمام دکمه‌ها */
}
.btn-action-small i {
    font-size: 14px; /* اندازه آیکن متناسب با ارتفاع دکمه */
}
.btn-action-small.disabled,
.btn-action-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-action-guess { background: #6d28d9; }
.btn-action-kill { background: #b91c1c; }

.count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; padding: 4px; }
.count-wrapper {
    display: flex; align-items: center; gap: 10px; border-radius: 16px; overflow: hidden; border: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; height: 72px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding: 8px;
}
.count-wrapper:active { transform: scale(0.97); }
.cnt-select { flex-grow: 1; background: transparent; color: var(--text); border: none; font-size: 28px; font-weight: 900; padding: 0; cursor: pointer; letter-spacing: 0.5px; transition: color 0.2s ease; text-align: center; }
.count-wrapper:hover .cnt-select { color: var(--accent); }
.cnt-info { width: 48px; height: 48px; align-self: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; border-radius: 12px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.cnt-info:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent) 0%, color-mix(in srgb, var(--accent) 15%, transparent) 100%); transform: translateY(-2px) scale(1.05); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.count-wrapper:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset, 0 0 20px color-mix(in srgb, var(--accent) 10%, transparent); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.name-row { display: flex; align-items: center; background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%); margin-bottom: 0; padding: 14px 16px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); border: 2px solid rgba(255, 255, 255, 0.08); gap: 12px; min-width: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: visible; box-sizing: border-box; }
.name-row::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%); opacity: 0; transition: opacity 0.3s ease; }
.name-row:hover { border-color: color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset; transform: translateY(-2px); }
.name-row:hover::before { opacity: 1; }
.name-row.dragging { opacity: 0.6; transform: scale(0.98); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.name-row.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); transform: scale(1.02); outline: none; }
.name-input { background: transparent; border: none; color: var(--text); flex-grow: 1; flex-shrink: 1; text-align: right; padding: 10px 12px; font-size: 16px; font-weight: 600; outline: none; min-width: 0; border-radius: 8px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box; }
.name-input::placeholder { color: #64748b; font-weight: 400; }
.name-input:focus { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent), 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 20px; padding: 14px 20px; z-index: 100; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); box-sizing: border-box; }
.name-row:has(.name-input:focus) .drag-handle,
.name-row:has(.name-input:focus) .seat-num-setup,
.name-row:has(.name-input:focus) .controls,
.name-row.input-focused .drag-handle,
.name-row.input-focused .seat-num-setup,
.name-row.input-focused .controls { opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.seat-num-setup { width: 44px; height: 44px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #0f172a; margin-left: 4px; flex-shrink: 0; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); border: 2px solid rgba(255, 255, 255, 0.1); transition: all 0.3s ease; }
.name-row:hover .seat-num-setup { transform: scale(1.1) rotate(5deg); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 50%, transparent); }
.drag-handle { display: flex; align-items: center; justify-content: center; color: #64748b; cursor: grab; padding: 8px; border-radius: 8px; transition: all 0.2s ease; flex-shrink: 0; width: 36px; height: 36px; }
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); opacity: 1; }
.name-row:hover .drag-handle { opacity: 1; }
.controls { display: flex; gap: 6px; margin-right: 2px; align-items: center; flex-shrink: 0; }
.ctrl-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255, 255, 255, 0.1); color: #cbd5e1; padding: 8px; border-radius: 10px; font-size: 14px; cursor: pointer; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.ctrl-btn:hover { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; transform: translateY(-2px); }
.ctrl-btn:active { transform: translateY(0) scale(0.95); }
.del-btn { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; border-radius: 10px; padding: 8px; font-size: 14px; }
.del-btn:hover { background: rgba(239, 68, 68, 0.25); border-color: #ef4444; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.del-btn:active { transform: translateY(0) scale(0.95); }
.clear-btn-pill { padding: 10px 16px; border-radius: 12px; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); font-size: 13px; color: #ef4444; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; transition: all 0.3s ease; }
.clear-btn-pill:hover { background: rgba(239, 68, 68, 0.25); border-color: #ef4444; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.clear-btn-pill:active { transform: translateY(0) scale(0.95); }
.clear-btn-pill[style*="background: var(--accent)"] { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%) !important; color: #0f172a !important; border: none !important; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.clear-btn-pill[style*="background: var(--accent)"]:hover { background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%) !important; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); }

.mode-selection-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.mode-card { border: 2px solid rgba(255, 255, 255, 0.15); border-radius: 16px; padding: 20px; margin-bottom: 0; background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%); cursor: pointer; display: flex; align-items: flex-start; gap: 14px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); position: relative; overflow: hidden; }
.mode-card::before { content: ''; position: absolute; top: 0; right: 0; width: 100%; height: 100%; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent) 0%, color-mix(in srgb, var(--accent) 5%, transparent) 100%); opacity: 0; transition: opacity 0.3s ease; }
.mode-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.8) 100%); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 20%, transparent); transform: translateY(-2px); }
.mode-card:hover::before { opacity: 1; }
.mode-card.selected { border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent), 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.mode-card.selected::before { opacity: 1; }
.mode-icon { font-size: 28px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.mode-title { font-weight: 700; display: block; font-size: 15px; color: #f8fafc; margin-bottom: 6px; }
.mode-card.selected .mode-title { color: var(--accent); font-weight: 800; }
.mode-card small { font-size: 12px; color: #94a3b8; display: block; line-height: 1.5; }
.mode-card.selected small { opacity: 0.9; color: var(--accent); }

.player-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%); 
    margin-bottom: 12px; 
    padding: 16px 18px; 
    border-radius: 18px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-right: 2px solid rgba(99, 102, 241, 0.2);
    min-height: 70px; 
    position: relative; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1) inset;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
body:not(.day-mode) .player-row::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.8) 0%, rgba(99, 102, 241, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 18px 0 0 18px;
}
body:not(.day-mode) .player-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2) inset;
    border-color: rgba(99, 102, 241, 0.4);
}
body:not(.day-mode) .player-row:hover::before {
    opacity: 1;
}
body.day-mode .player-row {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    padding: 16px 18px;
    border-radius: 18px;
    border: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
    min-height: 70px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
body.day-mode .player-row::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 18px 0 0 18px;
}
body.day-mode .player-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
body.day-mode .player-row:hover::before {
    opacity: 1;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    flex: 1;
}

.player-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.seat-circle-day {
    width: 34px; height: 34px; background: #000; color: #fff; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-weight: bold; margin-left: 10px; flex-shrink: 0;
    font-size: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
body.day-mode .seat-circle-day {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 12px;
    margin-left: 12px;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.1);
}
.wake-order-badge {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #000; border-radius: 12px; font-weight: 900; font-size: 16px;
    margin-left: 16px; flex-shrink: 0; box-shadow: var(--md-shadow);
}

.p-info { flex-grow: 1; text-align: right; }
body.day-mode .p-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.p-name { font-weight: bold; font-size: 15px; }
body.day-mode .p-name {
    font-weight: 800;
    font-size: 1.1em;
    color: #0f172a;
    line-height: 1.4;
}
.p-role { font-size: 13px; opacity: 1; margin-top: 2px; }

.ability-tag { display: inline-flex; align-items: center; gap: 4px; background: rgba(99, 102, 241, 0.15); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.35); padding: 2px 8px; border-radius: 10px; font-size: 12px; margin-right: 8px; font-weight:800; box-shadow: var(--md-shadow); }

.day-ability-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 8px;
    opacity: 0.85;
}
body:not(.day-mode) .day-ability-tag {
    display: none;
}
body.day-mode .day-ability-tag {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent-muted-on-light);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    padding: 4px 10px;
    font-weight: 700;
    margin-right: 0;
}

.p-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid;
}

.badge-shield {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.3);
}

.badge-silence {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.3);
}

.badge-masonic {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-list-action { padding: 8px 12px; font-size: 12px; border-radius: 12px; border: 1px solid var(--border-color); background: transparent; color: var(--text); cursor: pointer; transition: background 0.2s ease; }
.btn-list-action:hover { background: rgba(255,255,255,0.05); }
.btn-list-action.disabled { opacity: 0.5; cursor: not-allowed; }
.btn-list-action.disabled:hover { background: transparent; }
.btn-list-action.btn-icon-action { padding: 8px; min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.btn-list-action.btn-icon-action:hover { background: rgba(255,255,255,0.1); }
body.day-mode .btn-list-action {
    padding: 10px;
    border: 2px solid var(--border-color);
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
}
body.day-mode .btn-list-action:hover {
    background: rgba(0,0,0,0.06);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    transform: translateY(-1px);
}

.btn-gun-announce { 
    padding: 10px 16px; 
    font-size: 13px; 
    font-weight: 600;
    border-radius: 12px; 
    border: 2px solid #dc2626; 
    background: rgba(220, 38, 38, 0.15); 
    color: #dc2626; 
    cursor: pointer; 
    transition: all 0.2s ease;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-left: 8px;
}
.btn-gun-announce:hover { 
    background: rgba(220, 38, 38, 0.25); 
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.btn-gun-announce.disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    background: rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
    color: #6b7280;
}
.btn-gun-announce.disabled:hover { 
    background: rgba(107, 114, 128, 0.15);
    transform: none;
    box-shadow: none;
}
body.day-mode .btn-gun-announce {
    background: rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
    color: #dc2626;
    font-size: 16px;
    font-weight: 800;
}
body.day-mode .btn-gun-announce:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}
body.day-mode .btn-gun-announce.disabled {
    background: rgba(107, 114, 128, 0.1);
    border-color: #9ca3af;
    color: #9ca3af;
}

/* دکمه صحبت - مشابه دکمه اعلام گان */
.btn-speak { 
    padding: 10px 16px; 
    font-size: 13px; 
    font-weight: 600;
    border-radius: 12px; 
    border: 2px solid var(--accent); 
    background: rgba(249, 115, 22, 0.15); 
    color: var(--accent); 
    cursor: pointer; 
    transition: all 0.2s ease;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-left: 8px;
}
.btn-speak:hover { 
    background: rgba(249, 115, 22, 0.25); 
    border-color: var(--accent-deep);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
body.day-mode .btn-speak {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    font-size: 16px;
    font-weight: 800;
}
body.day-mode .btn-speak:hover {
    background: rgba(249, 115, 22, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

/* استایل موبایل برای دکمه‌های صحبت و اعلام گان - فقط آیکن */
@media (max-width: 480px) {
    .btn-speak,
    .btn-gun-announce {
        min-width: auto;
        width: auto;
        padding: 10px 12px;
        gap: 0;
    }
    
    /* مخفی کردن متن با استفاده از text-indent و overflow */
    .btn-speak,
    .btn-gun-announce {
        text-indent: -9999px;
        overflow: hidden;
        white-space: nowrap;
        position: relative;
    }
    
    /* نمایش آیکن */
    .btn-speak i,
    .btn-gun-announce i {
        font-size: 16px !important;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        margin: 0;
    }
    
    body.day-mode .btn-speak i,
    body.day-mode .btn-gun-announce i {
        font-size: 18px !important;
    }
    
    /* بهینه‌سازی بیشتر برای نمایش نام بازیکن در موبایل‌های کوچک */
    .name-row {
        padding: 10px 8px;
        gap: 6px;
        overflow: hidden; /* جلوگیری از خروج المان‌ها از کادر */
    }
    
    .name-input {
        font-size: 13px;
        padding: 6px 8px;
        min-width: 50px; /* حداقل عرض کمتر برای فضای بیشتر controls */
        max-width: 100%; /* جلوگیری از overflow */
        flex-shrink: 1; /* اجازه کوچک شدن برای controls */
    }
    
    .seat-num-setup {
        width: 34px;
        height: 34px;
        font-size: 14px;
        flex-shrink: 0; /* نباید کوچک شود */
    }
    
    .drag-handle {
        width: 28px;
        height: 28px;
        padding: 4px;
        flex-shrink: 0; /* نباید کوچک شود */
    }
    
    .drag-handle i {
        font-size: 12px;
    }
    
    .controls {
        gap: 3px;
        flex-shrink: 0; /* controls نباید کوچک شوند */
    }
    
    .ctrl-btn,
    .del-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 4px;
        font-size: 11px;
        flex-shrink: 0; /* دکمه‌ها نباید کوچک شوند */
    }
    
    .ctrl-btn i,
    .del-btn i {
        font-size: 12px;
    }
}

.dead { opacity: 0.6; filter: grayscale(1); background: rgba(0,0,0,0.05) !important; border-color: transparent !important; }
.dead .p-name { text-decoration: line-through; text-decoration-color: var(--mafia-color); text-decoration-thickness: 2px; }
.day-mode .dead .p-name { text-decoration: line-through; text-decoration-color: var(--mafia-color); text-decoration-thickness: 3px; }
.dead::after { content: 'خارج شده'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-10deg); color: #ef4444; border: 2px solid #ef4444; padding: 2px 8px; border-radius: 6px; font-weight: 900; font-size: 18px; pointer-events: none; opacity: 0.8; z-index: 10;}
body.hide-dead .dead { display: none !important; }

/* Night mode player-row background is already set in .player-row definition above */
body:not(.day-mode) .p-role { font-size: 1.4em; font-weight: 800; color: #fff; display: block; margin-bottom: 4px; }
body:not(.day-mode) .p-name { font-size: 0.9em; color: #94a3b8; font-weight: normal; }
body.day-mode .wake-order-badge, body.day-mode .guess-btn-container { display: none !important; }
body.day-mode .p-name { font-size: 1.1em; font-weight: 700; color: #0f172a; }
body.day-mode #duel-section { display: none !important; }

.ability-ref-btn { background: #6366f1; color: white; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; border:none; cursor: pointer; display:inline-flex; align-items:center; justify-content:center; margin-right:4px; }

.god-alert { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--accent); color: var(--accent); padding: 10px; border-radius: 12px; font-size: 13px; margin-bottom: 15px; display: none; text-align: right; }
body:not(.day-mode) .god-alert { display: block; }

.actions-grid { display: flex; gap: 10px; margin-bottom: 15px; margin-top: 12px; }
.day-mode .actions-grid { 
    margin-top: 8px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.day-mode .actions-grid.activity-count-1 {
    grid-template-columns: 1fr;
}
.day-mode .actions-grid.activity-count-2 {
    grid-template-columns: repeat(2, 1fr);
}
.day-mode .actions-grid.activity-count-3 {
    grid-template-columns: repeat(3, 1fr);
}
.day-mode .actions-grid.activity-count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
}
.action-tile {
    flex: 1; 
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%); 
    color: var(--text); 
    border-radius: 16px; 
    padding: 16px 12px;
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    align-items: center; 
    gap: 10px;
    font-size: 14px; 
    font-weight: 800; 
    cursor: pointer; 
    border: 2px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1) inset; 
    height: 70px; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
body:not(.day-mode) .action-tile::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}
body:not(.day-mode) .action-tile:hover::before {
    opacity: 1;
}
.day-mode .action-tile {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 16px;
    padding: 24px 16px 20px;
    flex-direction: column;
    height: 80px;
    gap: 4px;
    font-size: 13px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.day-mode .action-tile::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.day-mode .action-tile:hover::before {
    opacity: 1;
}
body:not(.day-mode) .action-tile:hover { 
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2) inset; 
    transform: translateY(-3px); 
    border-color: rgba(99, 102, 241, 0.4);
}
.action-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); transform: translateY(-1px); }
.day-mode .action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.action-tile:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.day-mode .action-tile:active {
    transform: translateY(-1px) scale(0.98);
}
.action-tile span { font-size: 20px; }
.day-mode .action-tile span {
    margin-bottom: 0;
    margin-top: 4px;
}
#btn-estelam-action { background: rgba(16, 185, 129, 0.15); color: #10b981; border-color: rgba(16, 185, 129, 0.4); }
#btn-estelam-action:hover { background: rgba(16, 185, 129, 0.25); }
#btn-estelam-action:active { background: rgba(16, 185, 129, 0.3); }
body.day-mode #btn-estelam-action {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}
body.day-mode #btn-estelam-action:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.5);
}
#btn-roles-list { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border-color: rgba(59, 130, 246, 0.4); }
#btn-roles-list:hover { background: rgba(59, 130, 246, 0.25); }
#btn-roles-list:active { background: rgba(59, 130, 246, 0.3); }
body.day-mode #btn-roles-list {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.3);
}
body.day-mode #btn-roles-list:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}
#btn-duel-toggle { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); margin-top: 85px; height: 70px; font-size: 14px; }
#btn-duel-toggle:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }
#btn-duel-toggle:active { background: color-mix(in srgb, var(--accent) 30%, transparent); }
#btn-night-music { margin-top: 85px; height: 70px; }
.night-music-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}
.night-music-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}
.night-music-btn:active {
    transform: translateY(0) scale(0.95);
}
.night-music-btn.active {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.7);
    color: #60a5fa;
}
body.day-mode .night-music-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}
body.day-mode .night-music-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}
body.day-mode .night-music-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}
body.day-mode #btn-duel-toggle {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
    color: var(--accent-muted-on-light);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
body.day-mode #btn-duel-toggle:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--accent) 15%, transparent) 100%);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
#btn-timer { background: rgba(168, 85, 247, 0.15); color: #a855f7; border-color: rgba(168, 85, 247, 0.4); }
#btn-timer:hover { background: rgba(168, 85, 247, 0.25); }
#btn-timer:active { background: rgba(168, 85, 247, 0.3); }
body.day-mode #btn-timer {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    color: #7c3aed;
    border-color: rgba(168, 85, 247, 0.3);
}
body.day-mode #btn-timer:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-color: rgba(168, 85, 247, 0.5);
}
#btn-court { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; border-color: rgba(139, 92, 246, 0.4); }
#btn-court:hover { background: rgba(139, 92, 246, 0.25); }
#btn-court:active { background: rgba(139, 92, 246, 0.3); }
body.day-mode #btn-court {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    color: #6d28d9;
    border-color: rgba(139, 92, 246, 0.3);
}
body.day-mode #btn-court:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(139, 92, 246, 0.5);
}
#btn-terrorist { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
#btn-terrorist:hover { background: rgba(239, 68, 68, 0.25); }
#btn-terrorist:active { background: rgba(239, 68, 68, 0.3); }
body.day-mode #btn-terrorist {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}
body.day-mode #btn-terrorist:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
}

.action-tile.disabled { background: #444; opacity: 0.5; cursor: not-allowed; border-color: #555; }
.day-mode .action-tile.disabled { background: #d1d5db; color: #9ca3af; border-color: #e5e7eb; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--md-scrim);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.28s cubic-bezier(0.2, 0, 0, 1);
}
.modal-overlay:not(.hidden) { opacity: 1; }
body.day-mode .modal-overlay {
    pointer-events: none;
}
body.day-mode .modal-overlay:not(.hidden) {
    pointer-events: all;
}
.modal-content {
    background: var(--md-modal-surface);
    width: 100%;
    max-width: 600px;
    padding: 24px 24px 40px;
    border-radius: 28px 28px 0 0;
    text-align: center;
    border: 1px solid var(--md-outline);
    border-bottom: none;
    animation: slideUp 0.32s cubic-bezier(0.2, 0, 0, 1);
    color: var(--text);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4), var(--md-elevation-modal);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body.day-mode .modal-content {
    background: var(--md-modal-surface);
    padding: 28px 24px 36px;
    border: 1px solid var(--md-outline);
    border-bottom: none;
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.1), var(--md-elevation-modal-day);
    border-radius: 28px 28px 0 0;
}
.modal-content h3 {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--md-outline);
    margin: 0 0 20px;
    color: var(--text);
    font-weight: 800;
    font-size: 20px;
    line-height: 1.35;
}
.modal-content h3 i {
    color: inherit;
}
body.day-mode .modal-content h3 {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.modal-content p,
.modal-content li {
    color: var(--text);
    font-size: 15px;
    line-height: 1.75;
}
.modal-content p {
    margin: 0 0 16px;
}
.modal-content p:last-child {
    margin-bottom: 0;
}
.modal-content .modal-subtitle,
.modal-content .hint-line {
    color: var(--md-on-surface-variant);
    font-size: 14px;
    line-height: 1.65;
}
body.day-mode .modal-content p {
    margin-bottom: 24px;
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-modal {
    flex: 1;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-main);
}

.btn-modal-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-modal-red:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-modal-gray {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.12) 0%, rgba(203, 213, 225, 0.08) 100%);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-modal-gray:hover {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.2) 0%, rgba(203, 213, 225, 0.15) 100%);
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Material 3: دیالوگ شناور در عرض کافی (خوانایی + تمرکز بصری) */
@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
        padding: 24px 16px;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    }
    .modal-content {
        border-radius: 28px;
        border: 1px solid var(--md-outline);
        width: min(100% - 32px, 600px);
        max-width: 600px;
        padding-bottom: 28px;
        box-shadow: var(--md-elevation-modal);
        animation: modalEnter 0.28s cubic-bezier(0.2, 0, 0, 1);
    }
    body.day-mode .modal-content {
        border-radius: 28px;
        border: 1px solid var(--md-outline);
        box-shadow: var(--md-elevation-modal-day);
        animation: modalEnter 0.28s cubic-bezier(0.2, 0, 0, 1);
    }
}
@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 20%, var(--border-color) 80%, transparent 100%);
    margin: 20px 0;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Role Content Reveal Animations - نرم و زیبا */
@keyframes roleContentFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes roleContentSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes roleContentScaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes roleContentFadeScale {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes roleContentSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes roleContentZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes roleContentRotateIn {
    0% {
        opacity: 0;
        transform: rotate(-5deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes roleContentBounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    80% {
        transform: translateY(2px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes roleContentElastic {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes roleContentFadeSlide {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation classes for role content wrapper */
.role-content-anim-fade {
    animation: roleContentFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-slide-up {
    animation: roleContentSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-scale {
    animation: roleContentScaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-fade-scale {
    animation: roleContentFadeScale 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-slide-down {
    animation: roleContentSlideDown 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-zoom {
    animation: roleContentZoomIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.role-content-anim-rotate {
    animation: roleContentRotateIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.role-content-anim-bounce {
    animation: roleContentBounceIn 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.role-content-anim-elastic {
    animation: roleContentElastic 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.role-content-anim-fade-slide {
    animation: roleContentFadeSlide 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Group Entry Modal Styles */
.group-entry-modal-content { text-align: right; }
.group-entry-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.group-entry-info { margin-bottom: 20px; }
.group-entry-count-badge { font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); padding: 4px 10px; border-radius: 8px; display: inline-block; }
.group-entry-selected-badge { font-weight: 700; color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--accent) 10%, transparent) 100%); padding: 12px 16px; border-radius: 12px; text-align: center; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin-bottom: 12px; font-size: 15px; }
.group-entry-distribution-badge { font-weight: 600; background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%); padding: 10px 16px; border-radius: 12px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.15); margin-bottom: 20px; font-size: 14px; color: var(--text); line-height: 1.6; }
.group-entry-distribution-badge span.mafia-count { color: var(--mafia-color); font-weight: 700; }
.group-entry-distribution-badge span.citizen-count { color: var(--citizen-color); font-weight: 700; }
.group-entry-distribution-badge span.independent-count { color: var(--indep-color); font-weight: 700; }
.group-entry-players-list { max-height: 400px; overflow-y: auto; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.group-entry-players-list::-webkit-scrollbar { width: 6px; }
.group-entry-players-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.group-entry-players-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 10px; }
.group-entry-players-list::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 50%, transparent); }
.group-entry-player-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%); border: 2px solid rgba(255, 255, 255, 0.08); border-radius: 14px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; min-height: 56px; }
.group-entry-player-item::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%); opacity: 0; transition: opacity 0.3s ease; }
.group-entry-player-item:hover { border-color: color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
.group-entry-player-item:hover::before { opacity: 1; }
.group-entry-player-item.selected { border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.group-entry-player-item.selected::before { opacity: 1; }
.group-entry-checkbox { width: 24px; height: 24px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
.group-entry-label { flex: 1; cursor: pointer; font-size: 18px; font-weight: 700; color: var(--text); margin: 0; text-align: right; letter-spacing: 0.5px; line-height: 1.8; padding: 4px 0; word-spacing: 2px; }
.group-entry-player-item.selected .group-entry-label { color: var(--accent); font-weight: 800; text-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.group-entry-actions { display: flex; gap: 12px; margin-top: 20px; }
.group-entry-actions .btn { margin-bottom: 0; }

/* Day mode adjustments for group entry modal */
body.day-mode .group-entry-player-item { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%); border-color: rgba(0, 0, 0, 0.08); }
body.day-mode .group-entry-player-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
body.day-mode .group-entry-player-item.selected { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent) 0%, color-mix(in srgb, var(--accent) 6%, transparent) 100%); }
body.day-mode .group-entry-label { color: var(--text); }
body.day-mode .group-entry-selected-badge { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
body.day-mode .group-entry-distribution-badge { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%); border-color: rgba(0, 0, 0, 0.12); color: var(--text); }

/* Day mode adjustments for stage 3 */
body.day-mode .mode-card { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%); border-color: rgba(0, 0, 0, 0.08); }
body.day-mode .mode-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
body.day-mode .mode-card.selected { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent) 0%, color-mix(in srgb, var(--accent) 6%, transparent) 100%); }
body.day-mode .mode-title { color: var(--text); }
body.day-mode .mode-card.selected .mode-title { color: var(--accent); }
body.day-mode .mode-card small { color: var(--text); opacity: 0.7; }
body.day-mode .mode-card.selected small { color: var(--accent); opacity: 0.9; }
body.day-mode .table-seat-name { background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%); color: #0f172a; border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.hidden { display: none !important; }
.day-only { display: none !important; } body.day-mode .day-only { display: flex !important; }
.night-only { display: none !important; } body:not(.day-mode) .night-only { display: block !important; }
body:not(.day-mode) .night-only.action-tile { display: flex !important; }
body:not(.day-mode) .night-only.card { display: block !important; }
body:not(.day-mode) .night-info-bar.night-only { display: none !important; }

.winner-banner { padding: 15px; border-radius: 14px; margin-bottom: 15px; font-weight: 800; display: none; text-align: center; font-size: 18px; box-shadow: var(--md-shadow); }
.banner-mafia { background: #7f1d1d; color: #fecaca; border: 2px solid #ef4444; }
.banner-city { background: #1e3a8a; color: #bfdbfe; border: 2px solid #3b82f6; }

#table-container { width: 100%; max-width: 520px; height: 620px; border: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 50% / 50%; margin: 24px auto; position: relative; background: radial-gradient(ellipse at center, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%); box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), 0 0 40px color-mix(in srgb, var(--accent) 25%, transparent), 0 8px 32px rgba(0, 0, 0, 0.4); }
#table-container::before { content: ''; position: absolute; top: 50%; right: 50%; transform: translate(50%, -50%); width: 80%; height: 80%; border: 2px dashed color-mix(in srgb, var(--accent) 20%, transparent); border-radius: 50%; pointer-events: none; }
.table-seat { position: absolute; width: 72px; height: 72px; cursor: grab; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 10; transform: translate(-50%, -50%); }
.table-seat:active { cursor: grabbing; }
.table-seat.dragging { z-index: 1000; opacity: 0.85; transform: translate(-50%, -50%) scale(1.15); cursor: grabbing; }
.table-seat:hover:not(.dragging) { transform: translate(-50%, -50%) scale(1.08); }
.table-seat-circle { width: 100%; height: 100%; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: #0f172a; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 2px 4px rgba(255, 255, 255, 0.2); border: 2px solid rgba(255, 255, 255, 0.25); position: relative; transition: all 0.3s ease; }
.table-seat:hover .table-seat-circle { transform: scale(1.05); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 50%, transparent), 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent); }
.table-seat.dragging .table-seat-circle { box-shadow: 0 10px 32px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 2px 4px rgba(255, 255, 255, 0.3); }
.table-seat-drag-handle { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; background: rgba(15, 23, 42, 0.95); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 13px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.2s; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.table-seat:hover .table-seat-drag-handle { opacity: 1; }
.table-seat-name { position: absolute; background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%); color: #f8fafc; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent); min-width: 70px; text-align: center; pointer-events: none; z-index: 20; backdrop-filter: blur(8px); }
.table-seat-drop-zone { position: absolute; width: 85px; height: 85px; border: 3px dashed color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--accent) 15%, transparent); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.table-seat-drop-zone.active { opacity: 1; }
@media (max-width: 600px) { 
    #table-container { height: min(620px, 70vh); min-height: 550px; margin: 15px auto; max-width: 100%; } 
    .table-seat { width: 64px; height: 64px; } 
    .table-seat-circle { font-size: 20px; } 
    .table-seat-name { font-size: 12px; padding: 6px 10px; } 
    #role-name-display { font-size: 32px !important; }
    #role-side-display { font-size: 20px !important; }
    #role-image-display { max-width: 280px !important; max-height: 280px !important; }
    .count-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } 
    .count-wrapper { height: 68px; padding: 6px; } 
    .cnt-select { font-size: 24px; } 
    .cnt-info { width: 44px; height: 44px; font-size: 16px; } 
    .count-card .card-header { margin-bottom: 20px; padding-bottom: 12px; } 
    .count-card h3 { font-size: 22px; } 
    .intro-hero h1 { font-size: 26px; } 
    .btn-guide-link, .btn-music-link { width: 100%; max-width: 200px; } 
    
    /* Day mode responsive */
    body.has-sticky-header.day-mode .container {
        padding: 16px;
        padding-top: 150px !important;
    }
    
    body.day-mode .actions-grid {
        gap: 10px;
    }
    
    body.day-mode .action-tile {
        padding: 18px 14px;
        height: 75px;
        font-size: 12px;
    }
    
    body.day-mode .action-tile span {
        font-size: 20px;
    }
    
    body.day-mode .player-row {
        padding: 14px 16px;
    }
    
    body.day-mode .p-name {
        font-size: 1.05em;
    }
    
    /* بهینه‌سازی نمایش نام بازیکن در موبایل */
    .name-row {
        padding: 12px 10px;
        gap: 8px;
        overflow: hidden; /* جلوگیری از خروج المان‌ها از کادر */
    }
    
    .name-input {
        font-size: 14px;
        padding: 8px 10px;
        min-width: 60px; /* حداقل عرض کمتر برای فضای بیشتر controls */
        max-width: 100%; /* جلوگیری از overflow */
        overflow: hidden; /* برای text-overflow: ellipsis */
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1; /* اجازه کوچک شدن برای controls */
    }
    
    .seat-num-setup {
        width: 38px;
        height: 38px;
        font-size: 16px;
        margin-left: 2px;
        flex-shrink: 0; /* نباید کوچک شود */
    }
    
    .drag-handle {
        width: 32px;
        height: 32px;
        padding: 6px;
        flex-shrink: 0; /* نباید کوچک شود */
    }
    
    .controls {
        gap: 4px;
        margin-right: 0;
        flex-shrink: 0; /* controls نباید کوچک شوند */
    }
    
    .ctrl-btn,
    .del-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
        font-size: 12px;
        flex-shrink: 0; /* دکمه‌ها نباید کوچک شوند */
    }
}

/* بهینه‌سازی برای تبلت (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* افزایش عرض container برای استفاده بهتر از فضای تبلت */
    .container {
        max-width: 750px;
        padding: 20px 24px;
    }
    
    body.has-sticky-header.day-mode .container,
    body.day-mode .container {
        padding-top: 160px !important;
    }
    
    /* بهینه‌سازی table container */
    #table-container {
        max-width: 600px;
        height: 720px;
        margin: 28px auto;
    }
    
    /* بزرگ‌تر کردن صندلی‌ها برای تبلت */
    .table-seat {
        width: 78px;
        height: 78px;
    }
    
    .table-seat-circle {
        font-size: 24px;
    }
    
    .table-seat-name {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* بهینه‌سازی نمایش نقش */
    #role-name-display {
        font-size: 48px !important;
    }
    
    #role-side-display {
        font-size: 28px !important;
    }
    
    #role-image-display {
        max-width: 380px !important;
        max-height: 380px !important;
    }
    
    /* بهینه‌سازی grid های شمارش */
    .count-grid {
        gap: 20px;
    }
    
    .count-wrapper {
        height: 85px;
        padding: 10px;
    }
    
    .cnt-select {
        font-size: 28px;
    }
    
    .cnt-info {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .count-card .card-header {
        margin-bottom: 28px;
        padding-bottom: 18px;
    }
    
    .count-card h3 {
        font-size: 30px;
    }
    
    /* بهینه‌سازی intro hero */
    .intro-hero {
        padding: 28px 18px;
        margin-bottom: 48px;
    }
    
    .intro-hero h1 {
        font-size: 36px;
    }
    
    .intro-hero p {
        font-size: 16px;
    }
    
    .btn-guide-link, .btn-music-link {
        max-width: 240px;
    }
    
    /* بهینه‌سازی Day mode */
    body.day-mode .actions-grid {
        gap: 16px;
    }
    
    body.day-mode .action-tile {
        padding: 28px 20px 24px;
        height: 90px;
        font-size: 14px;
    }
    
    body.day-mode .action-tile span {
        font-size: 24px;
    }
    
    body.day-mode .player-row {
        padding: 18px 20px;
    }
    
    body.day-mode .p-name {
        font-size: 1.15em;
    }
    
    /* بهینه‌سازی کارت‌ها */
    .card {
        padding: 28px;
        margin-bottom: 20px;
        border-radius: 20px;
    }
    
    /* بهینه‌سازی دکمه‌ها */
    .btn {
        padding: 14px;
        font-size: 16px;
        border-radius: 16px;
    }
    
    /* بهینه‌سازی section header */
    .section-header h2 {
        font-size: 26px;
    }
    
    /* بهینه‌سازی player rows */
    .player-row {
        padding: 16px 20px;
    }
    
    .p-name {
        font-size: 1.1em;
    }
    
    /* بهینه‌سازی modal‌های عمومی */
    .modal-content {
        max-width: 700px !important;
        padding: 32px 28px 48px !important;
        border-radius: 28px !important;
    }
    
    .modal-content h3 {
        font-size: 26px !important;
        margin-bottom: 24px !important;
        padding-bottom: 20px !important;
    }
    
    .modal-content p {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
    
    /* بهینه‌سازی player cards grid */
    .player-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px !important;
    }
    
    .player-card {
        padding: 14px 10px !important;
    }
    
    .player-card-name {
        font-size: 14px !important;
    }
    
    .player-card-id {
        font-size: 12px !important;
    }
    
    /* بهینه‌سازی header */
    .sticky-header {
        padding: 12px 20px;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        padding-left: calc(20px + env(safe-area-inset-left, 0px));
        padding-right: calc(20px + env(safe-area-inset-right, 0px));
    }
    
    body.day-mode .sticky-header {
        padding: 16px 22px 14px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
        padding-left: calc(22px + env(safe-area-inset-left, 0px));
        padding-right: calc(22px + env(safe-area-inset-right, 0px));
    }
    
    .app-title {
        font-size: 18px;
    }
    
    /* بهینه‌سازی bottom nav */
    .bottom-nav {
        padding: 0 16px;
        padding-left: calc(16px + env(safe-area-inset-left, 0px));
        padding-right: calc(16px + env(safe-area-inset-right, 0px));
    }
    
    body.day-mode .bottom-nav {
        padding: 0 18px;
        padding-left: calc(18px + env(safe-area-inset-left, 0px));
        padding-right: calc(18px + env(safe-area-inset-right, 0px));
    }
    
    .nav-btn {
        font-size: 11px;
        width: 80px;
    }
    
    .nav-btn i {
        font-size: 24px;
    }
    
    /* بهینه‌سازی night info bar */
    .night-info-bar {
        padding: 16px 22px;
        border-radius: 18px;
    }
}

.vote-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; font-size: 14px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--md-shadow); }
.vote-table th { background: #334155; color: #fff; padding: 12px 10px; font-weight: 800; }
.day-mode .vote-table th { background: #e2e8f0; color: #0f172a; }
.vote-table td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--md-outline); color: var(--text); font-weight: 600; }
.vote-table tr:last-child td { border-bottom: none; }
.vote-table tr:nth-child(even) { background-color: var(--table-row-even); }
.vote-table tr:nth-child(odd) { background-color: var(--table-row-odd); }

.btn-icon-small { width: 18px; height: 18px; border-radius: 50%; border: none; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.25); color: inherit; margin-right: 4px; }
.btn-info { width: 28px; height: 28px; font-size: 16px; margin-right: 8px; }

.score-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 10px; background: rgba(0,0,0,0.1); border-radius: 10px; }
.score-val { font-size: 24px; font-weight: 900; min-width: 30px; }

.top-info-box { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.info-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: bold; padding: 6px 12px; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.alive-badge { background: #3b82f6; color: #fff !important; }
.vote-badge { background: #ef4444; color: #fff !important; }
body:not(.day-mode) .vote-badge { display: none; }
#alive-badge.alive-badge { color: #fff !important; }
#vote-badge.vote-badge { color: #fff !important; }

select { width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 12px; background: var(--row-bg); color: var(--text); border: 1px solid #64748b; font-family: var(--font-main); font-size: 15px; outline: none; }

#guess-result-box { margin-top: 20px; padding: 15px; border-radius: 12px; background: rgba(0,0,0,0.1); border: 1px solid #64748b; }
.result-success { border-color: #10b981 !important; background: rgba(16, 185, 129, 0.1) !important; color: #10b981; }
.result-fail { border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; color: #ef4444; }

/* Night Info Bar (Compact Style) */
.night-info-bar {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 12px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    padding: 14px 18px; 
    border-radius: 16px; 
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1) inset;
    flex-wrap: wrap;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.night-info-bar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.night-info-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2) inset;
    border-color: rgba(99, 102, 241, 0.5);
}
.night-info-bar:hover::before {
    opacity: 1;
}
.night-stat-inline {
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 900;
    position: relative;
    z-index: 1;
}
.night-sep { 
    opacity: 0.7; 
    font-weight: 800; 
    font-size: 16px;
    color: rgba(163, 180, 252, 0.8);
}
.night-stat-label-inline { 
    font-size: 13px; 
    opacity: 0.85; 
    font-weight: 700;
    color: #c7d2fe;
    position: relative;
    z-index: 1;
}
.night-stat-val { 
    font-size: 20px; 
    font-weight: 900; 
    color: #a5b4fc; 
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
    padding: 6px 12px; 
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}
.night-stat-val:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Roles List Style */
.roles-list-col { text-align: right; margin-bottom: 15px; }
.roles-list-col h4 { margin: 5px 0; font-size: 15px; border-bottom: 1px solid rgba(128,128,128,0.3); padding-bottom: 3px; }
.role-item-mini { display: inline-block; background: rgba(0,0,0,0.2); padding: 2px 6px; margin: 2px; border-radius: 4px; font-size: 13px; }
#dist-info-content h4, #roles-list-content h4 { margin: 10px 0 5px 0; font-size: 15px; font-weight: 700; }
#dist-info-content span, #roles-list-content span { background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; margin: 2px; display: inline-block; font-size: 13px; }

/* Ability Buttons Container */
.ability-btn-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
    width: 100%; /* عرض کامل برای تقسیم مساوی فضا */
}

/* Base style for all ability buttons */
.btn-action-ability {
    padding: 12px 12px;
    font-size: 13px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--md-shadow);
    color: white;
    transition: transform 0.1s ease, opacity 0.2s ease;
    flex: 1; /* عرض یکسان برای تمام دکمه‌ها */
    min-width: 0; /* اجازه shrink شدن در صورت نیاز */
}
.btn-action-ability i {
    font-size: 14px; /* اندازه آیکن متناسب با ارتفاع دکمه */
}
.btn-action-ability i {
    font-size: 14px; /* اندازه آیکن متناسب با ارتفاع دکمه */
}

.btn-action-ability:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn-action-ability:active {
    transform: translateY(0);
    opacity: 0.8;
}

.btn-action-ability:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Hide ability buttons in day mode */
body.day-mode .ability-btn-container {
    display: none !important;
}

/* بزرگ‌تر کردن دکمه نفر بعدی و نمایش نقش در صفحه توزیع نقش */
#next-btn,
#show-btn {
    padding: 20px 28px !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    min-height: 68px;
    border-radius: 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#show-btn {
    box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent) !important;
}
#show-btn:hover {
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%) !important;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 60%, transparent) !important;
    transform: translateY(-2px) !important;
}
#show-btn:active {
    transform: translateY(0) !important;
}

/* Role reveal slider (bottom) - uses #show-btn styles as track */
#show-btn.role-slide-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
}

#show-btn.role-slide-track .role-slide-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
}

#show-btn.role-slide-track .role-slide-handle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    cursor: grab;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    will-change: transform;
}

#show-btn.role-slide-track .role-slide-handle i {
    font-size: 20px;
    color: rgba(248, 250, 252, 0.95);
}

#show-btn.role-slide-track.role-slide-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#show-btn.role-slide-track.role-slide-disabled .role-slide-handle {
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.25);
}
#next-btn {
    width: 100% !important;
    background: transparent !important;
    color: var(--accent) !important;
    border: 2px solid var(--accent) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 20%, transparent) !important;
}
#next-btn:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
    border-color: var(--accent-bright) !important;
    color: var(--accent-bright) !important;
    box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent) !important;
    transform: translateY(-2px) !important;
}
#next-btn:active {
    transform: translateY(0) !important;
    background: color-mix(in srgb, var(--accent) 15%, transparent) !important;
}

#card-area {
    padding: 40px !important;
    border: 3px dashed color-mix(in srgb, var(--accent) 40%, transparent) !important;
    border-radius: 24px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%) !important;
    backdrop-filter: blur(10px) !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    height: 500px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}
#card-area::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 5%, transparent) 0%, transparent 70%);
    pointer-events: none;
}

#role-image-display {
    max-width: 320px !important;
    max-height: 320px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.3s ease !important;
}
#role-image-display:hover {
    transform: scale(1.02) !important;
}

#role-name-display {
    font-size: 42px !important;
    font-weight: 900 !important;
    margin-bottom: 16px !important;
    color: #f8fafc !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
    z-index: 1 !important;
}

#role-side-display {
    font-size: 26px !important;
    font-weight: 800 !important;
    position: relative !important;
    z-index: 1 !important;
}
#role-side-display span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
}

/* PWA Install Banner Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 100%);
    color: var(--md-on-primary);
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.pwa-install-banner:not(.hidden) {
    transform: translateY(0);
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-install-icon {
    font-size: 24px;
    flex-shrink: 0;
    opacity: 0.9;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.pwa-install-subtitle {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-actions .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--md-on-primary);
    backdrop-filter: blur(10px);
}

.pwa-install-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: var(--md-on-primary);
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
    flex-shrink: 0;
}

.pwa-dismiss-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Adjust bottom nav when install banner is visible */
body.pwa-install-visible #bottom-nav {
    bottom: 80px;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .pwa-install-content {
        flex-wrap: wrap;
    }
    
    .pwa-install-text {
        flex-basis: 100%;
        margin-bottom: 8px;
    }
    
    .pwa-install-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .pwa-install-actions .btn {
        flex: 1;
    }
}

/* ============================================
   Speaking Order Modal Styles (Improved UI)
   ============================================ */

/* Options Grid - 2x2 for 4 options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.option-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: right;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.option-card:hover::before {
    background: currentColor;
}

.option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.option-icon {
    font-size: 20px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-left: 12px;
    flex-shrink: 0;
}

.option-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.option-description {
    font-size: 13px;
    color: #cbd5e1;
    margin-top: 8px;
    line-height: 1.6;
    font-weight: 500;
    opacity: 0.9;
}

.option-card.first-to-last { color: #3b82f6; }
.option-card.first-to-last .option-icon { background: rgba(59, 130, 246, 0.2); }
.option-card.last-to-first { color: #8b5cf6; }
.option-card.last-to-first .option-icon { background: rgba(139, 92, 246, 0.2); }
.option-card.random { color: var(--accent); }
.option-card.random .option-icon { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.option-card.moderator { color: #10b981; }
.option-card.moderator .option-icon { background: rgba(16, 185, 129, 0.2); }

.option-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: currentColor;
    margin-top: 8px;
}

/* Selected Player Card */
.selected-player-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(251, 146, 60, 0.1) 100%);
    border: 2px solid rgba(249, 115, 22, 0.4);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.selected-player-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.1) 0%, transparent 70%);
    animation: speakingOrderPulse 3s ease-in-out infinite;
}

@keyframes speakingOrderPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.selected-player-label {
    font-size: 14px;
    color: var(--accent-bright);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.selected-player-name {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.selected-player-id {
    font-size: 16px;
    color: var(--accent-bright);
    font-weight: 600;
}

/* Direction Cards */
.direction-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.direction-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.direction-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.direction-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.direction-card:hover::before {
    background: currentColor;
}

.direction-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.direction-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.direction-description {
    font-size: 13px;
    color: #94a3b8;
}

.direction-card.clockwise {
    color: #3b82f6;
}

.direction-card.clockwise .direction-icon-wrapper {
    background: rgba(59, 130, 246, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.direction-card.counter-clockwise {
    color: #8b5cf6;
}

.direction-card.counter-clockwise .direction-icon-wrapper {
    background: rgba(139, 92, 246, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* Player Selection */
.player-select-container {
    margin-bottom: 24px;
}

.player-select {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f1f5f9' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-right: 16px;
    padding-left: 40px;
}

.player-select:hover {
    border-color: rgba(249, 115, 22, 0.5);
    background-color: rgba(255, 255, 255, 0.08);
}

.player-select:focus {
    outline: none;
    border-color: var(--accent-deep);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* Player Cards Grid - 4 Columns (for many players) */
.player-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 450px;
    overflow-y: auto;
    padding: 8px;
    margin-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(249, 115, 22, 0.5) rgba(255, 255, 255, 0.1);
}

.player-cards-grid::-webkit-scrollbar {
    width: 8px;
}

.player-cards-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.player-cards-grid::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.5);
    border-radius: 10px;
}

.player-cards-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.7);
}

.player-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.player-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(16, 185, 129, 0.5);
}

.player-card.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.player-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.player-card.disabled:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.player-card-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-card-id {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

/* Confirm Modal */
.confirm-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(249, 115, 22, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.confirm-method-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    background: rgba(249, 115, 22, 0.2);
    color: var(--accent-bright);
}

.confirm-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-info-row:last-child {
    border-bottom: none;
}

.confirm-info-label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 600;
}

.confirm-info-value {
    font-size: 16px;
    color: #fff;
    font-weight: 700;
}

/* Auto Order Summary (for days after day 1) */
.auto-order-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.auto-order-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auto-order-info-row:last-child {
    border-bottom: none;
}

.auto-order-info-label {
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 600;
}

.auto-order-info-value {
    font-size: 17px;
    color: #fff;
    font-weight: 700;
}

.auto-order-note {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.6;
}

/* Day-mode styles for Speaking Order Modal */
body.day-mode .option-card {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .option-card:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode .option-title {
    color: #0f172a;
}

body.day-mode .option-description {
    color: #64748b;
    opacity: 0.95;
}

body.day-mode .option-badge {
    background: rgba(0, 0, 0, 0.08);
}

body.day-mode .selected-player-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(251, 146, 60, 0.05) 100%);
    border: 2px solid rgba(249, 115, 22, 0.3);
}

body.day-mode .selected-player-label {
    color: var(--accent-deep);
}

body.day-mode .selected-player-name {
    color: #0f172a;
}

body.day-mode .selected-player-id {
    color: var(--accent-deep);
}

body.day-mode .direction-card {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .direction-card:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode .direction-title {
    color: #0f172a;
}

body.day-mode .direction-description {
    color: #475569;
}

body.day-mode .player-select {
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

body.day-mode .player-select:hover {
    border-color: rgba(249, 115, 22, 0.4);
    background-color: rgba(0, 0, 0, 0.06);
}

body.day-mode .player-select:focus {
    border-color: var(--accent-deep);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

body.day-mode .player-cards-grid {
    scrollbar-color: rgba(249, 115, 22, 0.4) rgba(0, 0, 0, 0.1);
}

body.day-mode .player-cards-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.day-mode .player-card {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .player-card:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(16, 185, 129, 0.4);
}

body.day-mode .player-card.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

body.day-mode .player-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

body.day-mode .player-card.disabled:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

body.day-mode .player-card-name {
    color: #0f172a;
}

body.day-mode .player-card-id {
    color: #64748b;
}

body.day-mode .confirm-summary {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(249, 115, 22, 0.25);
}

body.day-mode .confirm-method-badge {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-deep);
}

body.day-mode .confirm-info-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .confirm-info-label {
    color: #64748b;
}

body.day-mode .confirm-info-value {
    color: #0f172a;
}

body.day-mode .auto-order-summary {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(59, 130, 246, 0.25);
}

body.day-mode .auto-order-info-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .auto-order-info-label {
    color: #64748b;
}

body.day-mode .auto-order-info-value {
    color: #0f172a;
}

body.day-mode .auto-order-note {
    color: #64748b;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Instruction text in speaking order modal */
body.day-mode #speaking-order-body p {
    color: #475569 !important;
}

body.day-mode #speaking-order-confirm-body p {
    color: #64748b !important;
}

/* Speaking Modal Icon Enhancement */
#speaking-modal .fa-comments {
    font-size: 26px !important;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(251, 146, 60, 0.15) 100%) !important;
    padding: 12px !important;
    border-radius: 14px !important;
    border: 2px solid rgba(249, 115, 22, 0.4) !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1) !important;
    color: var(--accent) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
}

#speaking-modal .fa-comments:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.35) 0%, rgba(251, 146, 60, 0.25) 100%) !important;
    border-color: rgba(249, 115, 22, 0.6) !important;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

body.day-mode #speaking-modal .fa-comments {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(251, 146, 60, 0.08) 100%) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.3) !important;
    color: var(--accent-deep) !important;
}

body.day-mode #speaking-modal .fa-comments:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22) 0%, rgba(251, 146, 60, 0.15) 100%) !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.4) !important;
}

/* بهینه‌سازی Modal‌ها برای تبلت */
@media (min-width: 768px) and (max-width: 1024px) {
    /* بهینه‌سازی مدال اصلی تعیین ترتیب صحبت برای تبلت */
    #speaking-order-modal .modal-content {
        padding: 32px 28px 40px !important;
        max-width: 700px !important;
    }
    
    #speaking-order-modal h3 {
        margin-bottom: 20px !important;
        font-size: 24px !important;
    }
    
    #speaking-order-modal h3 i {
        font-size: 26px !important;
        padding: 10px !important;
    }
    
    #speaking-order-body {
        font-size: 16px !important;
        margin: 16px 0 !important;
    }
    
    #speaking-order-body p {
        margin-bottom: 18px !important;
        font-size: 16px !important;
    }
    
    /* استفاده از grid 2 ستونه برای تبلت */
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px !important;
    }
    
    .option-card {
        padding: 22px !important;
        border-radius: 16px;
    }
    
    .option-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
        margin-left: 14px !important;
    }
    
    .option-title {
        font-size: 17px !important;
    }
    
    .option-description {
        font-size: 14px !important;
        margin-top: 10px !important;
    }
    
    .option-badge {
        font-size: 12px !important;
        padding: 5px 12px !important;
        margin-top: 10px !important;
    }
    
    /* بهینه‌سازی کارت بازیکن انتخاب شده */
    .selected-player-card {
        padding: 28px !important;
        margin-bottom: 24px !important;
    }
    
    .selected-player-label {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }
    
    .selected-player-name {
        font-size: 28px !important;
        margin-bottom: 10px !important;
    }
    
    .selected-player-id {
        font-size: 18px !important;
    }
    
    /* بهینه‌سازی کارت‌های جهت */
    .direction-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px !important;
    }
    
    .direction-card {
        padding: 22px !important;
    }
}

/* Responsive for Speaking Order Modal */
@media (max-width: 768px) {
    /* بهینه‌سازی مدال اصلی تعیین ترتیب صحبت */
    #speaking-order-modal .modal-content {
        padding: 20px 16px 32px !important;
        max-height: 92vh !important;
    }
    
    #speaking-order-modal h3 {
        margin-bottom: 16px !important;
        font-size: 18px !important;
        gap: 8px !important;
        flex-wrap: wrap;
    }
    
    #speaking-order-modal h3 i {
        font-size: 20px !important;
        padding: 8px !important;
    }
    
    #speaking-order-body {
        font-size: 14px !important;
        margin: 12px 0 !important;
        line-height: 1.6 !important;
    }
    
    #speaking-order-body p {
        margin-bottom: 14px !important;
        font-size: 14px !important;
    }
    
    /* بهینه‌سازی گزینه‌های انتخاب */
    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px !important;
    }
    
    .option-card {
        padding: 14px !important;
        border-radius: 12px;
    }
    
    .option-header {
        margin-bottom: 4px;
    }
    
    .option-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
        margin-left: 10px !important;
    }
    
    .option-title {
        font-size: 14px !important;
    }
    
    .option-description {
        font-size: 12px !important;
        margin-top: 6px !important;
        line-height: 1.5 !important;
    }
    
    .option-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
        margin-top: 6px !important;
    }
    
    /* بهینه‌سازی کارت بازیکن انتخاب شده */
    .selected-player-card {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
    
    .selected-player-label {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    
    .selected-player-name {
        font-size: 20px !important;
        margin-bottom: 6px !important;
    }
    
    .selected-player-id {
        font-size: 14px !important;
    }
    
    /* بهینه‌سازی کارت‌های جهت */
    .direction-cards {
        grid-template-columns: 1fr;
        gap: 10px !important;
    }
    
    .direction-card {
        padding: 16px !important;
    }
    
    .direction-icon {
        font-size: 40px !important;
        margin-bottom: 12px !important;
    }
    
    .direction-icon-wrapper {
        width: 70px !important;
        height: 70px !important;
        margin-bottom: 12px !important;
    }
    
    .direction-title {
        font-size: 16px !important;
        margin-bottom: 6px !important;
    }
    
    .direction-description {
        font-size: 12px !important;
    }
    
    /* بهینه‌سازی انتخاب بازیکن */
    .player-select-container {
        margin-bottom: 16px !important;
    }
    
    .player-select {
        padding: 12px 14px !important;
        font-size: 14px !important;
        padding-left: 36px !important;
    }
    
    .player-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px !important;
        max-height: 350px !important;
        padding: 6px !important;
        margin-bottom: 16px !important;
    }
    
    .player-card {
        padding: 8px 6px !important;
    }
    
    .player-card-name {
        font-size: 11px !important;
        margin-bottom: 3px !important;
    }
    
    .player-card-id {
        font-size: 10px !important;
    }
    
    /* بهینه‌سازی دکمه‌های عملیات */
    #speaking-order-actions {
        margin-top: 16px !important;
        gap: 8px !important;
    }
    
    #speaking-order-actions .btn {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
    
    /* بهینه‌سازی مدال تائید */
    #speaking-order-confirm-modal .modal-content {
        padding: 20px 16px 32px !important;
        max-height: 92vh !important;
    }
    
    #speaking-order-confirm-modal h3 {
        margin-bottom: 16px !important;
        font-size: 18px;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    #speaking-order-confirm-modal h3 i {
        font-size: 20px !important;
        padding: 8px !important;
    }
    
    #speaking-order-confirm-body {
        font-size: 14px !important;
        margin: 16px 0 !important;
    }
    
    .confirm-summary {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .confirm-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 0;
    }
    
    .confirm-info-label {
        font-size: 13px;
    }
    
    .confirm-info-value {
        font-size: 15px;
    }
    
    .confirm-method-badge {
        font-size: 13px;
        padding: 6px 12px;
        margin-bottom: 16px;
    }
    
    #speaking-order-confirm-modal .btn {
        font-size: 14px;
        padding: 10px;
    }
}

/* بهینه‌سازی انتخابگر محدودیت چالش در موبایل */
@media (max-width: 768px) {
    #speaking-order-body select,
    #speaking-order-body input[type="number"] {
        font-size: 14px !important;
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
    }
    
    #speaking-order-body label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }
}

@media (max-width: 480px) {
    /* بهینه‌سازی بیشتر برای موبایل‌های کوچک */
    #speaking-order-modal .modal-content {
        padding: 16px 12px 28px !important;
        max-height: 95vh !important;
    }
    
    #speaking-order-body select,
    #speaking-order-body input[type="number"] {
        font-size: 13px !important;
        padding: 8px 10px !important;
        margin-bottom: 10px !important;
    }
    
    #speaking-order-body label {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    
    #speaking-order-modal h3 {
        margin-bottom: 12px !important;
        font-size: 16px !important;
        gap: 6px !important;
    }
    
    #speaking-order-modal h3 i {
        font-size: 18px !important;
        padding: 6px !important;
    }
    
    #speaking-order-body {
        font-size: 13px !important;
        margin: 10px 0 !important;
        line-height: 1.5 !important;
    }
    
    #speaking-order-body p {
        margin-bottom: 12px !important;
        font-size: 13px !important;
    }
    
    /* بهینه‌سازی بیشتر گزینه‌ها */
    .options-grid {
        gap: 8px !important;
    }
    
    .option-card {
        padding: 12px !important;
    }
    
    .option-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
        margin-left: 8px !important;
    }
    
    .option-title {
        font-size: 13px !important;
    }
    
    .option-description {
        font-size: 11px !important;
        margin-top: 4px !important;
    }
    
    /* بهینه‌سازی کارت بازیکن انتخاب شده */
    .selected-player-card {
        padding: 14px !important;
        margin-bottom: 14px !important;
    }
    
    .selected-player-label {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    
    .selected-player-name {
        font-size: 18px !important;
        margin-bottom: 4px !important;
    }
    
    .selected-player-id {
        font-size: 13px !important;
    }
    
    /* بهینه‌سازی کارت‌های جهت */
    .direction-card {
        padding: 14px !important;
    }
    
    .direction-icon {
        font-size: 36px !important;
        margin-bottom: 10px !important;
    }
    
    .direction-icon-wrapper {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 10px !important;
    }
    
    .direction-title {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }
    
    .direction-description {
        font-size: 11px !important;
    }
    
    /* بهینه‌سازی انتخاب بازیکن */
    .player-select {
        padding: 10px 12px !important;
        font-size: 13px !important;
        padding-left: 32px !important;
    }
    
    .player-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px !important;
        max-height: 300px !important;
        padding: 5px !important;
        margin-bottom: 14px !important;
    }
    
    .player-card {
        padding: 6px 4px !important;
    }
    
    .player-card-name {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }
    
    .player-card-id {
        font-size: 9px !important;
    }
    
    /* بهینه‌سازی دکمه‌ها */
    #speaking-order-actions {
        margin-top: 14px !important;
        gap: 6px !important;
        flex-direction: column;
    }
    
    #speaking-order-actions .btn {
        font-size: 13px !important;
        padding: 10px 8px !important;
        width: 100%;
    }
    
    /* بهینه‌سازی مدال تائید */
    .player-cards-grid,
    .options-grid,
    .direction-cards {
        grid-template-columns: 1fr;
    }
    
    #speaking-order-confirm-modal .modal-content {
        padding: 16px 12px 28px !important;
        max-height: 95vh !important;
    }
    
    #speaking-order-confirm-modal h3 {
        margin-bottom: 12px !important;
        font-size: 16px;
        flex-wrap: wrap;
        gap: 6px !important;
    }
    
    #speaking-order-confirm-modal h3 i {
        font-size: 18px !important;
        padding: 6px !important;
    }
    
    #speaking-order-confirm-body {
        font-size: 13px !important;
        margin: 12px 0 !important;
        line-height: 1.6 !important;
    }
    
    .confirm-summary {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .confirm-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }
    
    .confirm-info-label {
        font-size: 12px;
    }
    
    .confirm-info-value {
        font-size: 14px;
        word-break: break-word;
    }
    
    .confirm-method-badge {
        font-size: 12px;
        padding: 5px 10px;
        margin-bottom: 12px;
    }
    
    #speaking-order-confirm-modal .btn {
        font-size: 13px;
        padding: 10px 8px;
    }
    
    #speaking-order-confirm-modal [style*="margin-top"] {
        margin-top: 16px !important;
    }
    
    #speaking-order-confirm-modal [style*="gap"] {
        gap: 8px !important;
    }
}

/* Override guide.css stat-label colors for alive and vote badges */
#alive-badge .stat-label,
#alive-badge .stat-icon,
#alive-badge i,
#vote-badge .stat-label,
#vote-badge .stat-icon,
#vote-badge i,
.stat-badge.bg-alive .stat-label,
.stat-badge.bg-alive .stat-icon,
.stat-badge.bg-alive i,
.stat-badge.bg-vote .stat-label,
.stat-badge.bg-vote .stat-icon,
.stat-badge.bg-vote i,
.bg-alive .stat-label,
.bg-alive .stat-icon,
.bg-alive i,
.bg-vote .stat-label,
.bg-vote .stat-icon,
.bg-vote i {
    color: white !important;
}

body.day-mode #alive-badge .stat-label,
body.day-mode #alive-badge .stat-icon,
body.day-mode #alive-badge i,
body.day-mode #vote-badge .stat-label,
body.day-mode #vote-badge .stat-icon,
body.day-mode #vote-badge i,
body.day-mode .stat-badge.bg-alive .stat-label,
body.day-mode .stat-badge.bg-alive .stat-icon,
body.day-mode .stat-badge.bg-alive i,
body.day-mode .stat-badge.bg-vote .stat-label,
body.day-mode .stat-badge.bg-vote .stat-icon,
body.day-mode .stat-badge.bg-vote i,
body.day-mode .bg-alive .stat-label,
body.day-mode .bg-alive .stat-icon,
body.day-mode .bg-alive i,
body.day-mode .bg-vote .stat-label,
body.day-mode .bg-vote .stat-icon,
body.day-mode .bg-vote i {
    color: white !important;
}

/* ========= صفحهٔ شروع و تقسیم نقش (کلاس‌محور) ========= */
.version-badge-soft {
    margin: 8px 0;
    font-size: 12px;
    opacity: 0.72;
    color: var(--accent);
    font-weight: 600;
}
.setup-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    align-items: center;
}
.setup-actions-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
}
.btn-setup-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 800;
    color: var(--md-on-primary);
    text-decoration: none;
    border: none;
    border-radius: var(--ui-radius-lg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 52%, color-mix(in srgb, var(--accent-deep) 75%, #020617) 100%);
    box-shadow:
        0 10px 32px color-mix(in srgb, var(--accent) 38%, transparent),
        0 1px 0 color-mix(in srgb, #fff 14%, transparent) inset;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}
.btn-setup-main:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 48%, transparent);
}
.btn-setup-main:active {
    transform: translateY(0);
    filter: brightness(0.96);
}
.btn-setup-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    flex: 1;
    font-size: 14px;
    font-weight: 800;
    border: none;
    border-radius: var(--ui-radius-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-setup-scenario {
    color: var(--md-on-primary);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-deep) 88%, #000) 0%, var(--accent) 100%);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-setup-scenario:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-setup-music {
    color: #f8fafc;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 48%, #9333ea 100%);
    box-shadow: 0 8px 24px color-mix(in srgb, #7c3aed 35%, transparent);
}
.btn-setup-music:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 32px color-mix(in srgb, #7c3aed 45%, transparent);
}
.setup-footer-block {
    margin-top: 30px;
    text-align: center;
}
.btn-cache-clear {
    opacity: 0.78;
    font-size: 13px;
}
.setup-sync-block {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
    padding-top: 20px;
}
.btn-sync-wide {
    font-size: 14px;
    padding: 12px 24px;
}
.card-header-actions {
    display: flex;
    gap: 8px;
}
.clear-btn-pill.flex-grow {
    flex: 1;
    min-width: 0;
}
.names-list-area {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.btn-row-flex {
    display: flex;
    gap: 10px;
}
.btn-flex-1 {
    flex: 1;
}
.btn-flex-2 {
    flex: 2;
}

.distribute-hero {
    text-align: center;
    margin-bottom: 24px;
}
.distribute-title {
    margin: 0 0 12px 0;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 900;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-shadow: 0 2px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.distribute-instruction {
    font-size: 18px;
    margin: 0 0 20px 0;
    color: var(--md-on-surface-variant);
    font-weight: 500;
}
.card.distribute-player-card {
    border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    padding: 28px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, transparent) 0%, color-mix(in srgb, var(--accent) 6%, transparent) 100%);
    box-shadow: 0 12px 36px color-mix(in srgb, var(--accent) 22%, transparent);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.distribute-player-card .glow-orb {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}
.distribute-player-name {
    color: var(--accent);
    margin: 0;
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    font-weight: 900;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 18px color-mix(in srgb, var(--accent) 32%, transparent);
}
.distribute-seat-label {
    font-size: 18px;
    color: var(--md-on-surface-variant);
    display: block;
    margin-top: 8px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}
.role-stage-wrap {
    margin: 28px 0;
    position: relative;
    min-height: 500px;
}
.role-panel {
    padding: 40px;
    border: 3px dashed color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--ui-radius-xl);
    background: linear-gradient(160deg, color-mix(in srgb, var(--md-surface-variant) 70%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 100%);
    backdrop-filter: blur(12px);
    height: 500px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
#role-placeholder.role-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}
#card-area.role-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.role-panel-inner-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 70%);
    pointer-events: none;
}
.role-placeholder-icon {
    font-size: 120px;
    color: color-mix(in srgb, var(--accent) 58%, transparent);
    position: relative;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}
#role-content-wrapper.role-content-flex {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
#role-image-display.role-image-frame {
    width: 100%;
    height: auto;
    margin: 0 auto 24px;
    display: block;
    max-width: 320px;
    max-height: 320px;
    border-radius: var(--ui-radius-lg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}
#role-slide-button.role-slide-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #fff) 0%, var(--accent-deep) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 10px 32px color-mix(in srgb, var(--accent) 45%, transparent);
    transition: all 0.3s ease;
    z-index: 10;
    border: 3px solid color-mix(in srgb, #fff 28%, transparent);
    user-select: none;
}
#role-slide-button.role-slide-knob .fa-grip-lines {
    font-size: 32px;
    color: #f8fafc;
}
#role-timer-circle.timer-corner {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    z-index: 10;
}
#role-timer-circle svg {
    transform: rotate(-90deg);
}
#role-timer-progress {
    stroke: color-mix(in srgb, var(--accent) 82%, transparent);
}
.distribute-slide-row {
    position: relative;
    width: 100%;
    min-height: 68px;
    margin-top: 40px;
}
#show-btn.role-slide-cta {
    padding: 20px 28px;
    font-size: 20px;
    font-weight: 900;
    min-height: 68px;
    width: 100%;
    border-radius: var(--ui-radius-lg);
    box-shadow: 0 10px 32px color-mix(in srgb, var(--accent) 38%, transparent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#next-btn.btn-next-overlay {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.distribute-footer-spacer {
    margin-top: 600px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.btn-accept-roles-wide {
    width: 100%;
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 800;
    border-radius: var(--ui-radius-md);
    background: linear-gradient(135deg, var(--md-success) 0%, color-mix(in srgb, var(--md-success) 70%, #064e3b) 100%);
    color: #f8fafc;
    box-shadow: 0 10px 32px color-mix(in srgb, var(--md-success) 35%, transparent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-reset-wide {
    width: 100%;
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 800;
    border-radius: var(--ui-radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#role-name-display,
#role-side-display {
    position: relative;
    z-index: 1;
}
