/* 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;
    padding-top: 70px; padding-bottom: 90px;
    transition: background-color 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
    width: 100%;
}
body.day-mode {
    padding-top: 95px; /* افزایش padding-top در فاز روز برای header-stats */
}

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

/* Select dropdown styling */
select {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
}

select option {
    background-color: var(--card-bg) !important;
    color: var(--text) !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);
    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: 6px 10px; border-radius: 12px; white-space: nowrap; display: flex; align-items: center; gap: 6px; box-shadow: var(--md-shadow); border: 1px solid var(--border-color); }
.day-mode .header-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.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);
}
.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-small { padding: 6px 12px; font-size: 12px; width: auto; margin: 0 2px; border-radius: 12px; box-shadow: none; }

.btn-action-small {
    padding: 6px 12px; font-size: 11px; border-radius: 12px; border: none; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px; box-shadow: var(--md-shadow); color: white;
}
.btn-action-guess { background: #6d28d9; }
.btn-action-kill { background: #b91c1c; }
.btn-action-save { background: #2563eb; }

.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: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-name-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 10px;
    flex-shrink: 0;
    gap: 4px;
}

.p-name-above {
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
    line-height: 1.3;
}

.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;
    flex-shrink: 0;
    font-size: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Responsive font sizing based on player count */
.players-few .p-name-above {
    font-size: 13px;
    max-width: 70px;
}

.players-medium .p-name-above {
    font-size: 12px;
    max-width: 65px;
}

.players-many .p-name-above {
    font-size: 11px;
    max-width: 60px;
}

.players-few .seat-circle-day {
    width: 34px; height: 34px; font-size: 16px;
}

.players-medium .seat-circle-day {
    width: 32px; height: 32px; font-size: 15px;
}

.players-many .seat-circle-day {
    width: 30px; height: 30px; font-size: 14px;
}

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

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

.dead { opacity: 0.6; filter: grayscale(1); background: rgba(0,0,0,0.05) !important; border-color: transparent !important; }
.dead .p-name, .dead .p-name-above { text-decoration: line-through; text-decoration-color: var(--mafia-color); text-decoration-thickness: 2px; }
.day-mode .dead .p-name, .day-mode .dead .p-name-above { 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 .role-info-container, 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 .p-name-above { 
    font-weight: 700; 
    color: #0f172a;
}
body.day-mode #duel-section { display: none !important; }

/* Responsive sizing for role text */
.players-few .p-role { font-size: 13px; }
.players-medium .p-role { font-size: 12px; }
.players-many .p-role { font-size: 11px; }

.players-few .p-info .p-name { font-size: 15px; }
.players-medium .p-info .p-name { font-size: 14px; }
.players-many .p-info .p-name { font-size: 13px; }

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

.seat-adjust-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 10px;
    align-items: center;
    justify-content: center;
}

.btn-seat-adjust {
    width: 34px;
    height: 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: var(--md-shadow);
    font-weight: 700;
    min-width: 34px;
}

.btn-seat-adjust i {
    font-size: 11px;
    line-height: 1;
}

.btn-seat-adjust:hover:not(:disabled) {
    background: var(--accent);
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-seat-adjust:active:not(:disabled) {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-seat-adjust:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: rgba(255,255,255,0.1);
    box-shadow: none;
    transform: none;
}

.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(2, 1fr); 
    gap: 10px; 
}
.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 {
    flex: none; /* Remove flex: 1 in day mode so grid can control sizing */
}
.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); }

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

.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-error { border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; color: #ef4444; }
.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; }
