/* 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;
    /* Material 3 inspired palette */
    --md-primary: #f59e0b;
    --md-on-primary: #0f172a;
    --md-surface: #0f172a;
    --md-on-surface: #f8fafc;
    --md-surface-variant: #1f2937;
    --md-outline: rgba(255,255,255,0.12);
    --md-secondary: #475569;
    --md-error: #ef4444;
    --md-success: #10b981;
    --md-shadow: 0 2px 6px rgba(0,0,0,0.15);

    --accent: var(--md-primary);
    --mafia-color: #ef4444;
    --citizen-color: #3b82f6;
    --indep-color: #d946ef;
    
    /* تم شب */
    --bg: var(--md-surface);
    --text: var(--md-on-surface);
    --card-bg: var(--md-surface-variant);
    --row-bg: #243044;
    --header-bg: rgba(15, 23, 42, 0.95);
    --bottom-nav-bg: rgba(30, 41, 59, 0.95);
    --btn-secondary: var(--md-secondary);
    --modal-bg: var(--md-surface-variant);
    --border-color: var(--md-outline);
}

/* تم روز */
body.day-mode {
    --md-surface: #f8fafc;
    --md-on-surface: #0f172a;
    --md-surface-variant: #ffffff;
    --md-outline: rgba(0,0,0,0.08);
    --bg: var(--md-surface);
    --text: var(--md-on-surface);
    --card-bg: var(--md-surface-variant);
    --row-bg: #e2e8f0;
    --header-bg: rgba(248, 250, 252, 0.95);
    --bottom-nav-bg: rgba(255, 255, 255, 0.95);
    --btn-secondary: #cbd5e1;
    --modal-bg: var(--md-surface-variant);
    --border-color: var(--md-outline);
}

body.mafia-win { --bg: #450a0a; --text: #fee2e2; }
body.city-win { --bg: #064e3b; --text: #d1fae5; }

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

body {
    background-color: var(--bg); 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: calc(70px + env(safe-area-inset-top, 0px));
    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;
    width: 100%;
}
body.day-mode {
    padding-top: calc(95px + env(safe-area-inset-top, 0px)); /* افزایش padding-top در فاز روز برای header-stats */
}

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(12px);
    z-index: 100; border-bottom: 1px solid var(--border-color);
    padding: 10px 16px; box-shadow: var(--md-shadow);
    /* 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;
}
.header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.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: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    transition: all 0.25s ease;
}
.phase-badge-day {
    background: rgba(245, 158, 11, 0.14); color: #b45309; border-color: rgba(245, 158, 11, 0.4);
}
.phase-badge-night {
    background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.4);
}

.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: 6px;
}
.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; }
.bg-alive { background: #3b82f6; color: white; }
.bg-vote { background: #ef4444; color: white; }
.bg-inquiry { background: #10b981; color: white; }

/* BOTTOM NAV */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 74px;
    background: var(--bottom-nav-bg); backdrop-filter: blur(12px);
    z-index: 100; border-top: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 10px; box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    /* 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));
}
.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;
}
.phase-fab.night { background: #4338ca; color: #e0e7ff; }
.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;
}
.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; }
.card { background: var(--card-bg); padding: 16px; margin-bottom: 16px; border-radius: 16px; box-shadow: var(--md-shadow); border: 1px solid var(--border-color); box-sizing: border-box; }

.intro-hero {
    text-align: center; padding: 8px 14px 8px 14px; margin-bottom: 8px;
}
.intro-hero h1 { margin: 6px 0 4px 0; font-size: 28px; font-weight: 900; }
.intro-hero p { margin: 8px 0 0 0; opacity: 0.75; font-size: 14px; }
.hero-subtitle { font-size: 13px; opacity: 0.75; font-weight: 700; }
.app-logo { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 24px; background: var(--row-bg); display: flex; align-items: center; justify-content: center; box-shadow: var(--md-shadow); border: 1px solid var(--border-color); }
.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: center; margin-bottom: 8px; }
.count-card h3 { margin: 4px 0 0 0; font-size: 18px; }
.label-sm { font-size: 11px; opacity: 0.7; }
.hint-pill { padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid var(--border-color); font-size: 12px; }

.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: transform 0.08s ease, box-shadow 0.2s ease; }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.btn-blue { background: #3b82f6; color: #fff; }
.btn-red { background: var(--md-error); color: #fff; }
.btn-gray { background: var(--btn-secondary); color: var(--text); }
.btn-yellow { background: var(--accent); color: var(--md-on-primary); }
.btn-purple { background: #7c3aed; color: #fff; }
.btn-green { background: #10b981; color: #fff; }
.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: 12px; margin-top: 10px; }
.count-wrapper {
    display: flex; align-items: center; gap: 8px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-color);
    background: var(--row-bg); box-shadow: var(--md-shadow); height: 64px; transition: transform 0.12s ease, box-shadow 0.2s ease; padding: 6px;
}
.count-wrapper:active { transform: scale(0.96); }
.cnt-select { flex-grow: 1; background: transparent; color: var(--text); border: none; font-size: 26px; font-weight: 900; padding: 0; cursor: pointer; letter-spacing: 0.5px; }
.cnt-info { width: 44px; height: 44px; align-self: center; background: rgba(255,255,255,0.08); border: none; border-left: 1px solid var(--border-color); color: var(--accent); font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; border-radius: 12px; transition: background 0.15s ease, transform 0.1s ease; }
.cnt-info:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.count-wrapper:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); transform: translateY(-1px); }

.name-row { display: flex; align-items: center; background: var(--row-bg); margin-bottom: 8px; padding: 8px 6px; border-radius: 14px; box-shadow: var(--md-shadow); gap: 4px; min-width: 0; }
.name-input { background: transparent; border: none; color: var(--text); flex-grow: 1; text-align: right; padding: 8px 4px; font-size: 15px; outline: none; min-width: 0; }
.seat-num-setup { width: 26px; height: 26px; background: rgba(0,0,0,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--accent); margin-left: 4px; flex-shrink: 0; }
.drag-handle { display: flex; align-items: center; justify-content: center; color: var(--text); opacity: 0.5; cursor: grab; padding: 4px 2px; flex-shrink: 0; transition: opacity 0.2s ease; }
.drag-handle:active { cursor: grabbing; opacity: 0.8; }
.name-row.dragging { opacity: 0.7; }
.name-row.drag-over { outline: 2px dashed var(--accent); }
.name-row:hover .drag-handle { opacity: 0.7; }
.controls { display: flex; gap: 4px; margin-right: 2px; align-items: center; flex-shrink: 0; }
.ctrl-btn { background: rgba(255,255,255,0.1); border: none; color: var(--text); padding: 6px 8px; border-radius: 8px; font-size: 12px; cursor: pointer; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s ease, transform 0.1s ease; }
.ctrl-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.15); }
.del-btn { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s ease, transform 0.1s ease; border-radius: 8px; padding: 6px 8px; }
.del-btn:active { transform: scale(0.95); background: rgba(239, 68, 68, 0.3); }
.del-btn:hover { background: rgba(239, 68, 68, 0.25); }
.clear-btn-pill { padding: 6px 12px; border-radius: 12px; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); font-size: 12px; color: #ef4444; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; transition: background 0.2s ease, transform 0.1s ease; }
.clear-btn-pill:hover { background: rgba(239, 68, 68, 0.2); }
.clear-btn-pill:active { transform: scale(0.95); background: rgba(239, 68, 68, 0.25); }

.mode-card { border: 1px solid var(--border-color); border-radius: 16px; padding: 15px; margin-bottom: 10px; background: var(--row-bg); cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.2s ease; box-shadow: var(--md-shadow); }
.mode-card.selected { border-color: var(--accent); background: rgba(245, 158, 11, 0.18); }
.mode-icon { font-size: 24px; }
.mode-title { font-weight: bold; display: block; font-size: 14px; }

.player-row {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--row-bg); margin-bottom: 10px; padding: 12px; border-radius: 16px;
    border-right: 6px solid transparent; min-height: 60px; position: relative; box-shadow: var(--md-shadow);
}

.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);
}
.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; }
.p-name { font-weight: bold; font-size: 15px; }
.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;
}

.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); }

.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;
}
body.day-mode .btn-gun-announce:hover {
    background: 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;
}

.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; }

body:not(.day-mode) .player-row { background: #2e2e35; }
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: rgba(245, 158, 11, 0.1); 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: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.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: var(--row-bg); color: var(--text); border-radius: 14px; padding: 12px 8px;
    display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 800; cursor: pointer; border: 2px solid var(--border-color);
    box-shadow: var(--md-shadow); height: 64px; transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.day-mode .action-tile {
    width: 100%;
}
.action-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); transform: translateY(-1px); }
.action-tile:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.action-tile span { font-size: 20px; }
#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); }
#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); }
#btn-duel-toggle { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.4); }
#btn-duel-toggle:hover { background: rgba(245, 158, 11, 0.25); }
#btn-duel-toggle:active { background: rgba(245, 158, 11, 0.3); }
#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); }
#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); }
#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); }

.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: rgba(0,0,0,0.85); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(5px); }
.modal-content { background: var(--modal-bg); width: 100%; max-width: 500px; padding: 25px; border-radius: 24px 24px 0 0; text-align: center; border-top: 1px solid var(--border-color); animation: slideUp 0.3s; padding-bottom: 40px; color: var(--text); box-shadow: var(--md-shadow); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.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; }

.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: 280px; height: 420px; border: 4px solid var(--border-color); border-radius: 140px; margin: 20px auto; position: relative; background: rgba(255,255,255,0.04); box-shadow: var(--md-shadow); }
.table-seat { position: absolute; width: 38px; height: 38px; background: var(--accent); color: #000; border-radius: 50%; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px; transform: translate(-50%, -50%); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.table-seat-name { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); font-size: 11px; white-space: nowrap; background: rgba(0,0,0,0.8); color: #fff; padding: 4px 6px; border-radius: 6px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }

.vote-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; font-size: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--md-shadow); }
.vote-table th { background: #334155; color: #fff; padding: 10px; }
.day-mode .vote-table th { background: #e2e8f0; color: #0f172a; }
.vote-table td { padding: 10px; text-align: center; border-bottom: 1px solid rgba(128,128,128,0.2); }
.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; }
.vote-badge { background: #ef4444; color: #fff; }
.estelam-badge { background: #10b981; color: #fff; }
body:not(.day-mode) .vote-badge, body:not(.day-mode) .estelam-badge { display: none; }

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: 8px;
    background: rgba(30, 41, 59, 0.95); border-bottom: 2px solid var(--accent);
    padding: 8px 12px; border-radius: 12px; margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    flex-wrap: wrap;
}
.night-stat-inline {
    display: inline-flex; align-items: center; gap: 6px; font-weight: 900;
}
.night-sep { opacity: 0.6; font-weight: 700; }
.night-stat-label-inline { font-size: 11px; opacity: 0.75; }
.night-stat-val { font-size: 18px; font-weight: 900; color: var(--accent); background: rgba(0,0,0,0.25); padding: 2px 8px; border-radius: 8px; }

/* 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: 18px 24px !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    min-height: 60px;
}

#card-area {
    padding: 35px !important;
}

#role-image-display {
    max-width: 350px !important;
    max-height: 350px !important;
}

#role-name-display {
    font-size: 36px !important;
    font-weight: 900 !important;
    margin-bottom: 15px !important;
}

#role-side-display {
    font-size: 24px !important;
    font-weight: 700 !important;
}

/* PWA Install Banner Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 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: 12px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.5;
}

.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: #f59e0b; }
.option-card.random .option-icon { background: rgba(245, 158, 11, 0.2); }
.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: #fbbf24;
    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: #fbbf24;
    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: #f97316;
    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-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: #fbbf24;
}

.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: #475569;
}

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: #d97706;
}

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

body.day-mode .selected-player-id {
    color: #d97706;
}

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: #f97316;
    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-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: #d97706;
}

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;
}

/* Responsive for Speaking Order Modal */
@media (max-width: 768px) {
    .player-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .options-grid,
    .direction-cards {
        grid-template-columns: 1fr;
    }
    
    #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: 480px) {
    .player-cards-grid,
    .options-grid,
    .direction-cards {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px 16px 30px;
        max-height: 90vh;
    }
    
    #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;
    }
}
