 body {
     font-family: 'Vazirmatn', 'sans-serif';
     background-color: #111827;
     color: #f3f4f6;
 }

 .page-content {
     display: none;
 }

 .page-content.active {
     display: block;
     animation: fadeIn 0.3s ease-in-out;
 }

 @keyframes fadeIn {
     from {
         opacity: 0;
         transform: translateY(10px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 .type-box.selected,
 .function-box.selected {
     outline: 2px solid #60a5fa;
     outline-offset: 2px;
     transform: scale(1.05);
     box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
 }

 #type-detail-long-text p,
 #function-detail-long-text p {
     margin-bottom: 1.5rem;
     line-height: 1.9;
     font-size: 1.125rem;
     color: #d1d5db;
     text-align: justify;
 }

 #type-detail-long-text h4,
 #function-detail-long-text h4 {
     font-size: 1.5rem;
     font-weight: 700;
     margin-top: 2.5rem;
     margin-bottom: 1rem;
     color: #93c5fd;
     border-bottom: 1px solid #374151;
     padding-bottom: 0.5rem;
 }

 #type-detail-long-text strong {
     color: #ffffff;
 }

 ::-webkit-scrollbar {
     width: 8px;
 }

 ::-webkit-scrollbar-track {
     background: #1f2937;
 }

 ::-webkit-scrollbar-thumb {
     background: #4b5563;
     border-radius: 4px;
 }

 ::-webkit-scrollbar-thumb:hover {
     background: #6b7280;
 }

 .info-card {
     transition: all 0.3s ease;
 }

 .info-card:hover {
     transform: translateY(-2px);
     background-color: rgba(255, 255, 255, 0.05);
 }

 .stat-bar-bg {
     background-color: #374151;
     border-radius: 9999px;
     height: 8px;
     width: 100%;
     overflow: hidden;
 }

 .stat-bar-fill {
     height: 100%;
     border-radius: 9999px;
     transition: width 1s ease-out;
 }

 .quiz-option-card {
     transition: all 0.2s ease;
 }

 .quiz-option-card:hover {
     transform: translateY(-2px);
 }

 .quiz-progress-bar {
     transition: width 0.3s ease-in-out;
 }

 .fade-in-quiz {
     animation: fadeInQuiz 0.4s ease-in-out;
 }

 @keyframes fadeInQuiz {
     from {
         opacity: 0;
         transform: translateY(5px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 .mezaj-question-box {
     transition: border-color 0.2s, background-color 0.2s;
 }

 .mezaj-question-box:hover {
     border-color: #e67e22;
     background-color: #2d3748;
 }

 .mezaj-radio {
     accent-color: #e67e22;
     width: 1.25rem;
     height: 1.25rem;
 }

 #page-practice {
     --game-primary: #f3f4f6;
     --game-accent: #60a5fa;
     --game-success: #34d399;
     --game-error: #f87171;
     --game-card-bg: #374151;
     --game-slot-bg: #1f2937;
     --game-slot-border: #4b5563;
     --subconscious-color: #c084fc;
     --superego-color: #fca5a5;
 }

 .game-select {
     font-size: 1.5rem;
     padding: 10px 20px;
     border-radius: 10px;
     background: #374151;
     color: #60a5fa;
     border: 2px solid #4b5563;
     font-weight: 800;
     cursor: pointer;
     margin: 10px 0;
     text-align: center;
     appearance: none;
     -webkit-appearance: none;
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
     transition: border-color 0.3s;
 }

 .game-select:focus {
     outline: none;
     border-color: #60a5fa;
 }

 .game-select option {
     background: #1f2937;
     color: #f3f4f6;
 }

 .game-container {
     width: 100%;
     max-width: 900px;
     margin: 0 auto;
     display: flex;
     flex-direction: column;
     gap: 30px;
 }

 .source-area {
     background: rgba(55, 65, 81, 0.5);
     padding: 20px;
     border-radius: 15px;
     min-height: 100px;
     display: flex;
     flex-wrap: wrap;
     justify-content: center;
     gap: 10px;
     border: 2px dashed #4b5563;
 }

 .function-card {
     width: 60px;
     height: 60px;
     background: var(--game-card-bg);
     color: #fff;
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-weight: bold;
     font-size: 1.2rem;
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
     cursor: pointer;
     user-select: none;
     transition: transform 0.2s, box-shadow 0.2s;
     position: relative;
     z-index: 10;
 }

 .function-card:active {
     transform: scale(0.95);
 }

 .function-card:hover {
     transform: translateY(-2px);
     box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
 }

 .card-N {
     border-top: 4px solid #fbbf24;
     color: #fbbf24;
 }

 .card-S {
     border-top: 4px solid #34d399;
     color: #34d399;
 }

 .card-T {
     border-top: 4px solid #60a5fa;
     color: #60a5fa;
 }

 .card-F {
     border-top: 4px solid #f87171;
     color: #f87171;
 }

 .stacks-wrapper {
     display: flex;
     justify-content: center;
     gap: 40px;
     width: 100%;
     flex-wrap: wrap;
 }

 .stack-column {
     background: rgba(31, 41, 55, 0.6);
     padding: 20px;
     border-radius: 15px;
     display: flex;
     flex-direction: column;
     gap: 20px;
     align-items: center;
     min-width: 280px;
     flex: 1;
     border: 1px solid #4b5563;
     transition: border-color 0.3s, background-color 0.3s;
 }

 .stack-column.subconscious-mode {
     border: 2px solid var(--subconscious-color);
     background: rgba(88, 28, 135, 0.2);
 }

 .stack-column.superego-mode {
     border: 2px solid var(--superego-color);
     background: rgba(127, 29, 29, 0.2);
 }

 .column-header {
     width: 100%;
     display: flex;
     flex-direction: column;
     align-items: center;
     border-bottom: 3px solid var(--game-accent);
     padding-bottom: 10px;
     margin-bottom: 10px;
     gap: 10px;
 }

 .stack-column.subconscious-mode .column-header {
     border-bottom-color: var(--subconscious-color);
 }

 .stack-column.superego-mode .column-header {
     border-bottom-color: var(--superego-color);
 }

 .column-title {
     font-size: 1.3rem;
     font-weight: bold;
     color: var(--game-primary);
     text-align: center;
     cursor: pointer;
     transition: opacity 0.2s;
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .column-title:hover {
     opacity: 0.7;
 }

 .stack-column.subconscious-mode .column-title {
     color: var(--subconscious-color);
 }

 .stack-column.superego-mode .column-title {
     color: var(--superego-color);
 }

 .toggle-btn {
     background-color: var(--game-accent);
     color: #111827;
     border: none;
     border-radius: 20px;
     padding: 5px 15px;
     font-size: 0.8rem;
     font-weight: bold;
     cursor: pointer;
     transition: all 0.3s;
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
 }

 .toggle-btn:hover {
     background-color: #93c5fd;
 }

 .stack-column.subconscious-mode .toggle-btn {
     background-color: var(--subconscious-color);
     color: white;
 }

 .stack-column.subconscious-mode .toggle-btn:hover {
     background-color: #a855f7;
 }

 .stack-column.superego-mode .toggle-btn {
     background-color: var(--superego-color);
     color: #111827;
 }

 .stack-column.superego-mode .toggle-btn:hover {
     background-color: #fca5a5;
 }

 .slot-wrapper {
     display: flex;
     flex-direction: row;
     align-items: center;
     gap: 15px;
     width: 100%;
     justify-content: flex-start;
     padding: 8px;
     background: rgba(55, 65, 81, 0.3);
     border-radius: 10px;
 }

 .slot {
     width: 60px;
     height: 60px;
     background: var(--game-slot-bg);
     border: 2px solid var(--game-slot-border);
     border-radius: 12px;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.3s;
     position: relative;
     flex-shrink: 0;
 }

 .slot.drag-over {
     background: #374151;
     border-color: var(--game-accent);
     transform: scale(1.05);
 }

 .slot.filled {
     border-color: var(--game-success);
     background: rgba(16, 185, 129, 0.1);
 }

 .role-name {
     font-size: 1rem;
     color: #d1d5db;
     font-weight: bold;
     cursor: pointer;
     transition: color 0.3s;
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .role-name:hover {
     color: var(--game-accent);
 }

 .info-icon {
     font-size: 0.9rem;
     opacity: 0.6;
     color: var(--game-accent);
 }

 .slot-number {
     position: absolute;
     top: -8px;
     right: -8px;
     background: #4b5563;
     color: white;
     width: 20px;
     height: 20px;
     border-radius: 50%;
     font-size: 0.7rem;
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 5;
 }

 .game-controls {
     display: flex;
     justify-content: center;
     gap: 15px;
     margin-top: 20px;
 }

 .game-btn {
     padding: 10px 25px;
     font-family: inherit;
     font-size: 1rem;
     border: none;
     border-radius: 8px;
     cursor: pointer;
     transition: background 0.3s;
     font-weight: bold;
 }

 .btn-next {
     background-color: var(--game-success);
     color: #064e3b;
     display: none;
 }

 .btn-next:hover {
     background-color: #6ee7b7;
 }

 .btn-reset {
     background-color: #4b5563;
     color: white;
 }

 .btn-reset:hover {
     background-color: #6b7280;
 }

 @keyframes shake {
     0% {
         transform: translateX(0);
     }

     25% {
         transform: translateX(-5px);
     }

     50% {
         transform: translateX(5px);
     }

     75% {
         transform: translateX(-5px);
     }

     100% {
         transform: translateX(0);
     }
 }

 .shake {
     animation: shake 0.4s ease-in-out;
     border-color: var(--game-error) !important;
     background-color: rgba(239, 68, 68, 0.4) !important;
 }

 .game-message {
     text-align: center;
     height: 30px;
     color: var(--game-success);
     font-weight: bold;
     margin-top: 10px;
 }

 .modal-overlay {
     display: none;
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.8);
     z-index: 1000;
     justify-content: center;
     align-items: center;
     opacity: 0;
     transition: opacity 0.3s ease;
 }

 .modal-overlay.active {
     display: flex;
     opacity: 1;
 }

 .modal-content {
     background: #1f2937;
     padding: 25px;
     border-radius: 15px;
     max-width: 500px;
     width: 90%;
     position: relative;
     transform: translateY(20px);
     transition: transform 0.3s ease;
     box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
     text-align: right;
     border: 1px solid #374151;
 }

 .modal-overlay.active .modal-content {
     transform: translateY(0);
 }

 .modal-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 15px;
     border-bottom: 2px solid #374151;
     padding-bottom: 10px;
 }

 .modal-title {
     font-size: 1.2rem;
     color: var(--game-primary);
     font-weight: bold;
     display: flex;
     align-items: center;
     gap: 10px;
 }

 .modal-number {
     background: var(--game-accent);
     color: #111827;
     width: 25px;
     height: 25px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 0.9rem;
     font-weight: bold;
 }

 .modal-number.info-mode {
     background: #9ca3af;
 }

 .close-btn {
     background: none;
     border: none;
     font-size: 1.5rem;
     color: #9ca3af;
     cursor: pointer;
     padding: 0;
     line-height: 1;
 }

 .close-btn:hover {
     color: var(--game-error);
 }

 .modal-body h4 {
     color: var(--game-accent);
     margin: 15px 0 5px 0;
     font-size: 1rem;
 }

 .modal-body p,
 .modal-body li {
     margin-bottom: 8px;
     font-size: 0.95rem;
     color: #d1d5db;
     line-height: 1.6;
 }

 /* حذف استایل پیش‌فرض مرورگر */
 .custom-range {
     -webkit-appearance: none;
     width: 100%;
     background: transparent;
     cursor: pointer;
 }

 .custom-range:focus {
     outline: none;
 }

 /* استایل نوار (Track) برای کروم و سافاری */
 .custom-range::-webkit-slider-runnable-track {
     width: 100%;
     height: 16px;
     /* ارتفاع نوار */
     border-radius: 999px;
 }

 /* استایل دکمه لغزنده (Thumb) برای کروم و سافاری */
 .custom-range::-webkit-slider-thumb {
     -webkit-appearance: none;
     height: 32px;
     /* اندازه دکمه */
     width: 32px;
     border-radius: 50%;
     background: #ffffff;
     border: 4px solid #8b5cf6;
     /* رنگ بنفش */
     box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
     /* سایه درخشان */
     margin-top: -8px;
     /* تراز کردن دکمه با نوار (نصف اختلاف ارتفاع دکمه و نوار) */
     transition: transform 0.1s ease;
 }

 .custom-range:active::-webkit-slider-thumb {
     transform: scale(1.1);
     /* بزرگ شدن هنگام کلیک */
     background: #f3e8ff;
 }

 /* استایل نوار (Track) برای فایرفاکس */
 .custom-range::-moz-range-track {
     width: 100%;
     height: 16px;
     border-radius: 999px;
 }

 /* استایل دکمه لغزنده (Thumb) برای فایرفاکس */
 .custom-range::-moz-range-thumb {
     height: 32px;
     width: 32px;
     border: 4px solid #8b5cf6;
     border-radius: 50%;
     background: #ffffff;
     cursor: pointer;
     box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
 }