.guide-container,
.guide-container-inline {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    gap: 0;
    background: var(--bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

#guide-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--bg);
    overflow: hidden;
}

.guide-header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--accent);
    padding: 24px 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent) inset;
    position: sticky;
    top: 0;
    z-index: 100;
}
body.day-mode .guide-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 2px 16px rgba(0,0,0,0.08), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent) inset;
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.guide-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    gap: 20px;
    position: relative;
}

.guide-header-top .header-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.guide-header-top h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
    letter-spacing: -0.3px;
}

.guide-header-top h1 .version {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.8;
}

.guide-header-top h1 i {
    flex-shrink: 0;
    font-size: 32px;
    color: var(--accent);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 50%, transparent));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 2px 4px color-mix(in srgb, var(--accent) 40%, transparent));
    }
    50% {
        filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--accent) 60%, transparent));
    }
}

.guide-header-top h1 > span:not(.version) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-guide-pdf {
    padding: 8px 16px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    text-decoration: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px;
    box-sizing: border-box;
}

.btn-guide-pdf:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    transform: translateY(-2px);
}

.btn-back {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #0f172a;
    text-decoration: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset;
    position: relative;
    overflow: hidden;
    min-height: 40px;
    box-sizing: border-box;
}

.btn-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-back:hover::before {
    left: 100%;
}

.btn-back: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), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset;
    transform: translateY(-2px) scale(1.02);
}

.btn-back:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-back i {
    transition: transform 0.3s ease;
}

.btn-back:hover i {
    transform: translateX(-3px);
}

/* Hamburger menu button */
.btn-menu-toggle {
    display: none;
    padding: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #0f172a;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset;
    position: relative;
    overflow: hidden;
}

.btn-menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-menu-toggle:hover::before {
    width: 100%;
    height: 100%;
}

.btn-menu-toggle: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), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset;
    transform: translateY(-2px) scale(1.05);
}

.btn-menu-toggle:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-menu-toggle i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-menu-toggle:hover i {
    transform: rotate(90deg);
}

.guide-sidebar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    padding: 32px 24px;
    border-left: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    box-shadow: -2px 0 12px rgba(0,0,0,0.1);
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    grid-column: 1;
}

.sidebar-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
body.day-mode .guide-sidebar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

/* Sidebar در desktop و تبلت همیشه نمایش داده می‌شود */
.guide-sidebar.mobile-hidden {
    display: block;
    transform: none;
    position: relative;
}

.guide-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-nav li {
    margin: 5px 0;
}

.guide-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.guide-nav a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.guide-nav a:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text);
    transform: translateX(-4px);
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.guide-nav a:hover::before {
    transform: scaleY(1);
}

.guide-nav a.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--accent) 10%, transparent) 100%);
    color: var(--accent);
    font-weight: 800;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
}

.guide-nav a.active::before {
    transform: scaleY(1);
}

.guide-nav a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
body.day-mode .guide-nav a.active {
    color: #0f172a;
}

.guide-main {
    overflow-y: auto;
    padding: 40px;
    background: var(--bg);
    -webkit-overflow-scrolling: touch;
    grid-column: 2;
    min-width: 0;
    overflow-x: hidden;
}
body.day-mode .guide-main {
    background: var(--bg);
}

.guide-breadcrumb {
    margin-bottom: 32px;
    padding: 16px 24px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    border-radius: 12px;
    border-right: 4px solid var(--accent);
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.guide-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
}

.guide-breadcrumb a i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.guide-breadcrumb a:hover {
    opacity: 0.8;
}

.guide-breadcrumb span {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0 8px;
}

.guide-content {
    line-height: 1.8;
    color: var(--text);
}

.guide-section {
    margin-bottom: 40px;
}

.guide-section h2 {
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent);
}

.guide-section h3 {
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 22px;
    font-weight: 800;
}

.guide-section h4 {
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
}

.guide-section p {
    margin: 10px 0;
    text-align: justify;
}

.guide-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}


.guide-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-radius: 12px;
    overflow: hidden;
    table-layout: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}
body.day-mode .guide-table {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.guide-table th,
.guide-table td {
    padding: 12px 10px;
    border: 1px solid var(--border-color);
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
}

.guide-table th {
    white-space: nowrap;
    font-size: 13px;
}

.guide-table td {
    white-space: normal;
    font-size: 13px;
}

/* Optimize column widths for mobile */
.guide-table th:first-child,
.guide-table td:first-child {
    min-width: 80px;
    max-width: 120px;
}

.guide-table th:nth-child(2),
.guide-table td:nth-child(2) {
    min-width: 70px;
    max-width: 100px;
}

.guide-table th:nth-child(n+3),
.guide-table td:nth-child(n+3) {
    min-width: 60px;
    max-width: 90px;
}

/* Navigation buttons */
.guide-section-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.guide-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #0f172a;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}

.guide-nav-btn: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);
}

.guide-nav-btn.guide-nav-disabled {
    background: transparent;
    color: transparent;
    cursor: default;
    pointer-events: none;
}

.guide-nav-btn.guide-nav-prev {
    flex-direction: row-reverse;
}

/* Role abilities display */
.role-abilities {
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
    border-radius: 12px;
    border-right: 4px solid var(--accent);
    font-size: 14px;
    color: var(--text);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 15%, transparent);
}

.role-abilities strong {
    color: var(--accent);
    margin-left: 8px;
}


.guide-table th {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #0f172a;
    font-weight: 800;
    font-size: 14px;
}

.guide-table tr:nth-child(even) {
    background: rgba(0,0,0,0.03);
}
body.day-mode .guide-table tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

/* Roles Grid */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.role-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin: 0;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
body.day-mode .role-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.role-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
body.day-mode .role-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.role-card.mafia {
    border-color: var(--mafia-color);
    border-right-width: 5px;
    border-right-color: var(--mafia-color);
}

.role-card.citizen {
    border-color: var(--citizen-color);
    border-right-width: 5px;
    border-right-color: var(--citizen-color);
}

.role-card.independent {
    border-color: var(--indep-color);
    border-right-width: 5px;
    border-right-color: var(--indep-color);
}

.role-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: zoom-in;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.role-image:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent);
    border-color: var(--accent);
}

.role-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
}

.role-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--accent);
    flex-shrink: 0;
}

.role-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.role-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-content h4 {
    display: none;
}

.role-content > div:first-of-type {
    line-height: 1.8;
    color: var(--text);
    font-size: 15px;
}

.role-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.role-tag {
    padding: 6px 12px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.tag {
    padding: 6px 12px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent) 0%, rgba(217, 119, 6, 0.05) 100%);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 24px 32px;
    text-align: center;
    margin: 0 auto 32px;
    position: relative;
    overflow: hidden;
    max-width: 800px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 0;
    text-align: center !important;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%);
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* Subtle pattern for informational appearance */
    background-image:
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.day-mode .stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.stat-card:hover {
    /* No attractive hover effects - keep it static and informational */
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

.stat-icon {
    font-size: 28px;
    color: rgba(71, 85, 105, 0.9);
    margin-bottom: 2px;
    opacity: 0.8;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: rgba(30, 41, 59, 1);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    font-size: 13px;
    color: rgba(71, 85, 105, 0.9);
    font-weight: 600;
    margin-top: 0;
    letter-spacing: 0.025em;
}

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


/* Content Section */
.content-section {
    margin-bottom: 48px;
}

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 8px;
    text-align: right !important;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 0;
}

.quick-link-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    padding: 24px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}
body.day-mode .quick-link-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.quick-link-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;
}
.quick-link-card:hover::before {
    opacity: 1;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
    border-color: var(--accent);
}
body.day-mode .quick-link-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.quick-link-card i {
    font-size: 40px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}
.quick-link-card:hover i {
    transform: scale(1.15) rotate(5deg);
}

.quick-link-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    position: relative;
    z-index: 1;
}

.subsection {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-radius: 12px;
    border-right: 4px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.day-mode .subsection {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.subsection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
body.day-mode .subsection:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.subsection h4 {
    margin-top: 0;
    color: var(--accent);
    font-weight: 800;
}

.highlight {
    background: rgba(255, 255, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Compact tables for playerCount section */
.guide-table-compact-wrapper {
    width: 100%;
}

.guide-table-compact-wrapper .guide-table-wrapper {
    overflow-x: hidden;
    width: 100%;
}

.guide-table-compact-wrapper .guide-table {
    table-layout: fixed;
    width: 100%;
}

.guide-table-compact-wrapper .guide-table th,
.guide-table-compact-wrapper .guide-table td {
    padding: 6px 4px;
    font-size: 11px;
}

.guide-table-compact-wrapper .guide-table {
    width: 100%;
}

.guide-table-compact-wrapper .guide-table th:first-child,
.guide-table-compact-wrapper .guide-table td:first-child {
    width: 25%;
}

.guide-table-compact-wrapper .guide-table th:nth-child(2),
.guide-table-compact-wrapper .guide-table td:nth-child(2) {
    width: 25%;
}

.guide-table-compact-wrapper .guide-table th:nth-child(3),
.guide-table-compact-wrapper .guide-table td:nth-child(3) {
    width: 25%;
}

.guide-table-compact-wrapper .guide-table th:nth-child(4),
.guide-table-compact-wrapper .guide-table td:nth-child(4) {
    width: 25%;
}

/* بهینه‌سازی برای تبلت (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* بهینه‌سازی layout container */
    .guide-container,
    .guide-container-inline {
        grid-template-columns: 320px 1fr;
    }
    
    .guide-sidebar {
        width: 320px;
    }
    
    /* بهینه‌سازی header */
    .guide-header {
        padding: 24px 32px;
    }
    
    .guide-header h1 {
        font-size: 24px;
        gap: 12px;
    }
    
    .guide-header h1 .version {
        font-size: 14px;
    }
    
    .guide-header h1 i {
        font-size: 28px;
    }
    
    .btn-back, .btn-guide-pdf {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 60px;
    }
    
    /* Sidebar همیشه نمایش داده شود و عرض بیشتر */
    .guide-sidebar {
        padding: 24px;
        width: 320px;
    }
    
    .guide-sidebar.mobile-hidden {
        display: block;
    }
    
    .guide-nav a {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    /* منوی toggle برای تبلت نمایش داده نشود */
    .btn-menu-toggle {
        display: none !important;
    }
    
    .guide-sidebar-overlay {
        display: none !important;
    }
    
    /* بهینه‌سازی main content */
    .guide-main {
        padding: 35px 40px;
    }
    
    /* بهینه‌سازی breadcrumb */
    .guide-breadcrumb {
        margin-bottom: 28px;
        padding: 14px 0 18px;
        font-size: 16px;
    }
    
    .guide-breadcrumb a {
        padding: 10px 18px;
        font-size: 15px;
    }
    
    .guide-breadcrumb a i {
        font-size: 15px;
    }
    
    /* بهینه‌سازی sections */
    .guide-section {
        margin-bottom: 45px;
    }
    
    .guide-section h2 {
        font-size: 30px;
        padding-bottom: 14px;
        margin-bottom: 28px;
    }
    
    .guide-section h3 {
        font-size: 26px;
        margin-top: 36px;
        margin-bottom: 18px;
    }
    
    .guide-section h4 {
        font-size: 20px;
        margin-top: 28px;
        margin-bottom: 14px;
    }
    
    .guide-section p {
        font-size: 16px;
        line-height: 1.85;
        margin: 12px 0;
    }
    
    /* بهینه‌سازی tables */
    .guide-table-wrapper {
        margin: 28px 0;
        border-radius: 14px;
    }
    
    .guide-table th,
    .guide-table td {
        padding: 14px 12px;
        font-size: 14px;
    }
    
    .guide-table th {
        font-size: 15px;
    }
    
    /* بهینه‌سازی stat cards */
    .stat-card {
        padding: 20px;
        gap: 10px;
        border-radius: 11px;
        background-size: 20px 20px;
    }

    .stat-icon {
        font-size: 24px;
        color: rgba(71, 85, 105, 0.85);
        opacity: 0.75;
    }

    .stat-value {
        font-size: 26px;
        color: rgba(30, 41, 59, 0.95);
    }

    .stat-label {
        font-size: 12px;
        color: rgba(71, 85, 105, 0.85);
    }

    /* بهینه‌سازی role cards */
    .roles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 24px;
    }
    
    .role-card {
        padding: 24px;
        gap: 16px;
    }
    
    .role-header {
        gap: 14px;
    }
    
    .role-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .role-name {
        font-size: 20px;
    }
    
    .role-image {
        max-width: 100%;
        height: auto;
    }
    
    .tags-container, .role-tags {
        gap: 8px;
        margin-top: 12px;
    }
    
    .role-tag, .tag {
        padding: 6px 12px;
        font-size: 12px;
    }
    

    /* بهینه‌سازی quick links */
    .quick-links {
        gap: 16px;
        margin-top: 35px;
    }
    
    .quick-link-card {
        padding: 32px 24px;
        border-radius: 18px;
    }
    
    .quick-link-card i {
        font-size: 56px;
        margin-bottom: 18px;
    }
    
    .quick-link-card h3 {
        font-size: 20px;
    }
    
    /* بهینه‌سازی subsections */
    .subsection {
        margin: 24px 0;
        padding: 24px;
        border-radius: 14px;
    }
    
    .subsection h4 {
        font-size: 19px;
        margin-top: 0;
    }
    
    /* بهینه‌سازی navigation buttons */
    .guide-section-nav {
        margin-top: 45px;
        padding-top: 28px;
        gap: 20px;
    }
    
    .guide-nav-btn {
        padding: 16px 28px;
        font-size: 16px;
        border-radius: 16px;
    }
    
    /* بهینه‌سازی compact tables */
    .guide-table-compact-wrapper .guide-table th,
    .guide-table-compact-wrapper .guide-table td {
        padding: 10px 6px;
        font-size: 13px;
    }
    
    /* بهینه‌سازی role abilities */
    .role-abilities {
        padding: 18px;
        font-size: 15px;
        border-radius: 14px;
    }
}

@media (max-width: 768px) {
    .guide-container,
    .guide-container-inline {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }
    
    .guide-header {
        padding: 14px 16px 12px;
        top: 0;
    }
    
    .guide-header-top {
        padding-bottom: 12px;
    }
    
    .guide-header-top::after {
        height: 1.5px;
    }
    
    .guide-header {
        padding: 16px 20px;
    }
    
    .guide-header-top {
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
    }
    
    .guide-header-top .header-title {
        flex: 1;
        min-width: 0;
        order: 1;
    }
    
    .guide-header-top h1 {
        font-size: 14px;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    
    .guide-header-top h1 > span:not(.version) {
        display: none;
    }
    
    .guide-header-top h1 .version {
        font-size: 11px;
        display: inline;
    }
    
    .guide-header-top h1 i {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .guide-header-actions {
        order: 2;
        flex-shrink: 0;
        gap: 6px;
    }
    
    .hero-section {
        padding: 32px 24px;
        margin-bottom: 32px;
    }
    
    .hero-title {
        font-size: 28px;
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        text-align: center !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 16px;
    }

    .stat-card {
        padding: 16px;
        gap: 8px;
        border-radius: 10px;
        background-size: 18px 18px;
    }

    .stat-icon {
        font-size: 22px;
        color: rgba(71, 85, 105, 0.85);
        opacity: 0.75;
    }

    .stat-value {
        font-size: 24px;
        color: rgba(30, 41, 59, 0.95);
    }

    .stat-label {
        font-size: 11px;
        color: rgba(71, 85, 105, 0.85);
    }

    /* Ensure stat cards remain informational on mobile */

    
    .stat-value {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 14px;
        text-align: right !important;
    }
    
    .btn-back, .btn-guide-pdf {
        padding: 8px 10px;
        font-size: 11px;
        min-height: 44px;
        flex-shrink: 0;
        gap: 4px;
    }

    .btn-guide-pdf {
        min-width: 120px;
        padding: 8px 16px;
        gap: 6px;
    }

    .btn-back span {
        display: none;
    }
    
    .btn-back i, .btn-guide-pdf i {
        font-size: 14px;
        margin: 0;
    }
    
    .btn-menu-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .btn-menu-toggle {
        display: flex;
    }
    
    
    .guide-sidebar {
        grid-column: 1;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 200;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -2px 0 8px rgba(0,0,0,0.2);
        border-left: 1px solid var(--border-color);
    }
    
    .guide-sidebar.mobile-hidden {
        display: none;
    }
    
    .guide-sidebar.mobile-visible {
        display: block;
        transform: translateX(0);
    }
    
    .guide-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }
    
    .guide-sidebar-overlay.mobile-visible {
        display: block;
    }
    
    .guide-main {
        grid-column: 1;
        padding: 20px 15px;
    }
    
    .guide-breadcrumb {
        margin-bottom: 18px;
        padding: 10px 0 12px;
        font-size: 14px;
        flex-wrap: wrap;
    }
    
    .guide-breadcrumb a {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .guide-breadcrumb a i {
        font-size: 12px;
    }
    
    .guide-section {
        margin-bottom: 30px;
    }
    
    .guide-section h2 {
        font-size: 20px;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }
    
    .guide-section h3 {
        font-size: 18px;
        margin-top: 25px;
        margin-bottom: 12px;
    }
    
    .guide-section h4 {
        font-size: 16px;
        margin-top: 18px;
        margin-bottom: 8px;
    }
    
    .guide-section p {
        font-size: 14px;
        line-height: 1.7;
        text-align: right;
    }
    
    .btn-print-scoring {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    .btn-print-scoring span {
        display: none;
    }
    
    .btn-print-scoring i {
        margin: 0 !important;
    }
    
    /* Make button container responsive */
    #scoring-section > div[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    #scoring-section > div[style*="display: flex"] h2 {
        width: 100%;
    }
    
    #scoring-section > div[style*="display: flex"] .btn-print-scoring {
        align-self: flex-end;
    }
    
    .guide-table-wrapper {
        margin: 15px -15px;
        border-radius: 0;
        overflow-x: hidden;
        width: calc(100% + 30px);
    }
    
    .guide-table {
        table-layout: fixed;
        width: 100%;
        max-width: 100%;
        min-width: unset;
    }
    
    .guide-table th {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        font-size: 10px;
        padding: 6px 3px;
        line-height: 1.3;
    }
    
    .guide-table td {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        font-size: 10px;
        padding: 6px 3px;
        line-height: 1.3;
    }
    
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
    }
    
    .role-card {
        padding: 20px;
        gap: 12px;
    }
    
    .role-header {
        gap: 12px;
    }
    
    .role-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .role-name {
        font-size: 18px;
    }
    
    .role-image {
        max-width: 100%;
        height: auto;
    }
    
    .role-content > div:first-of-type {
        font-size: 14px;
    }
    
    .quick-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 20px;
    }
    
    .guide-table-compact-wrapper .guide-table th,
    .guide-table-compact-wrapper .guide-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .guide-table-compact-wrapper .guide-table {
        width: 100%;
    }
    
    .guide-table-compact-wrapper .guide-table th:first-child,
    .guide-table-compact-wrapper .guide-table td:first-child,
    .guide-table-compact-wrapper .guide-table th:nth-child(2),
    .guide-table-compact-wrapper .guide-table td:nth-child(2),
    .guide-table-compact-wrapper .guide-table th:nth-child(3),
    .guide-table-compact-wrapper .guide-table td:nth-child(3),
    .guide-table-compact-wrapper .guide-table th:nth-child(4),
    .guide-table-compact-wrapper .guide-table td:nth-child(4) {
        width: 25%;
    }
    
    .quick-link-card {
        padding: 15px 10px;
    }
    
    .quick-link-card i {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .quick-link-card h3 {
        font-size: 13px;
    }
    
    .quick-link-card {
        padding: 20px 15px;
    }
    
    .quick-link-card i {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .quick-link-card h3 {
        font-size: 15px;
    }
    
    .subsection {
        margin: 15px 0;
        padding: 12px;
        border-right-width: 3px;
    }
    
    .subsection h4 {
        font-size: 16px;
        margin-top: 0;
    }
    
    .role-tags {
        gap: 6px;
        justify-content: center;
    }
    
    .role-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .btn-guide-pdf {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 10px;
    }

    .guide-header h1 span {
        display: none;
    }
    
    .guide-header h1 i.fa-book {
        display: none;
    }
    
    .quick-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .quick-link-card {
        padding: 12px 8px;
    }
    
    .quick-link-card i {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .quick-link-card h3 {
        font-size: 11px;
    }
    
    .guide-table {
        width: 100%;
        table-layout: fixed;
    }
    
    .guide-table th,
    .guide-table td {
        padding: 8px 6px;
        font-size: 12px;
        white-space: normal;
        word-break: break-word;
    }
    
    .guide-table th:first-child,
    .guide-table td:first-child {
        width: 30%;
        min-width: 0;
        max-width: 30%;
    }
    
    .guide-table th:nth-child(2),
    .guide-table td:nth-child(2) {
        width: 25%;
        min-width: 0;
        max-width: 25%;
    }
    
    .guide-table th:nth-child(3),
    .guide-table td:nth-child(3) {
        width: 25%;
        min-width: 0;
        max-width: 25%;
    }
    
    .guide-table th:nth-child(4),
    .guide-table td:nth-child(4) {
        width: 20%;
        min-width: 0;
        max-width: 20%;
    }
    
    /* For tables with more columns */
    .guide-table th:nth-child(n+5),
    .guide-table td:nth-child(n+5) {
        width: 16%;
        min-width: 0;
        max-width: 16%;
        font-size: 9px;
        padding: 5px 2px;
    }
    
    .guide-section-nav {
        flex-direction: column;
        gap: 10px;
        margin-top: 30px;
    }
    
    .guide-nav-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .guide-main {
        padding: 15px 12px;
    }

    .stat-card {
        padding: 14px;
        gap: 6px;
        border-radius: 8px;
        background-size: 16px 16px;
    }

    .stat-icon {
        font-size: 20px;
        color: rgba(71, 85, 105, 0.85);
        opacity: 0.75;
    }

    .stat-value {
        font-size: 22px;
        color: rgba(30, 41, 59, 0.95);
    }

    .stat-label {
        font-size: 10px;
        color: rgba(71, 85, 105, 0.85);
    }
}

/* Print button styles */
.btn-print-scoring {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-print-scoring:hover {
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%) !important;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 50%, transparent) !important;
    transform: translateY(-2px);
}

.btn-print-scoring:active {
    transform: translateY(0) scale(0.98);
}

/* Print styles for scoring section */
@media print {
    .guide-container,
    .guide-container-inline,
    .guide-sidebar,
    .guide-header,
    .guide-section-nav,
    .btn-print-scoring,
    .guide-breadcrumb {
        display: none !important;
    }
    
    .guide-main {
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .guide-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .subsection {
        page-break-inside: avoid;
        break-inside: avoid;
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
    }
    
    h2, h3, h4 {
        page-break-after: avoid;
    }
    
    .guide-section h2 {
        color: var(--accent) !important;
        border-bottom: 3px solid var(--accent) !important;
    }
    
    .subsection h4 {
        color: var(--accent) !important;
    }
}

