/* Millionaire Game Styles */
#millionaire-game-container {
     background: rgba(0, 0, 0, 0.95);
     z-index: 2000;
     display: flex;
     align-items: center;
     justify-content: center;
}

.millionaire-layout {
     display: flex;
     width: 90%;
     height: 90%;
     max-width: 1200px;
     background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
     border-radius: 20px;
     box-shadow: 0 0 50px rgba(102, 126, 234, 0.3);
     overflow: hidden;
     border: 2px solid #667eea;
}

.millionaire-sidebar {
     width: 250px;
     background: rgba(0, 0, 0, 0.5);
     border-right: 1px solid #444;
     display: flex;
     flex-direction: column;
     padding: 20px;
}

.ladder-title {
     color: #ffd700;
     font-weight: bold;
     text-align: center;
     margin-bottom: 20px;
     font-size: 1.2rem;
     text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.money-ladder {
     display: flex;
     flex-direction: column;
     gap: 5px;
     flex: 1;
     justify-content: center;
}

.ladder-item {
     display: flex;
     justify-content: space-between;
     padding: 5px 10px;
     color: #888;
     font-family: monospace;
     font-size: 1.1rem;
     border-radius: 4px;
}

.ladder-item.active {
     background: #ffd700;
     color: #000;
     font-weight: bold;
     box-shadow: 0 0 15px #ffd700;
}

.ladder-item.completed {
     color: #4caf50;
}

.ladder-item.safe-haven {
     color: #fff;
}

.millionaire-main {
     flex: 1;
     display: flex;
     flex-direction: column;
     padding: 30px;
     position: relative;
     overflow-y: auto;
}

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

.game-logo {
     font-size: 2rem;
     font-weight: bold;
     background: linear-gradient(45deg, #667eea, #764ba2);
     background-clip: text;
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
}

.close-game-btn {
     background: none;
     border: none;
     color: #fff;
     font-size: 2rem;
     cursor: pointer;
     opacity: 0.7;
     transition: 0.3s;
}

.close-game-btn:hover {
     opacity: 1;
     transform: scale(1.1);
}

.game-content {
     flex: 1;
     display: flex;
     flex-direction: column;
     justify-content: center;
     gap: 20px;
     transition: opacity 0.3s;
}

/* Lifelines */
.lifelines-container {
     display: flex;
     justify-content: center;
     gap: 20px;
     margin-bottom: 20px;
}

.lifeline-btn {
     background: linear-gradient(to bottom, #141e30, #243b55);
     border: 2px solid #667eea;
     border-radius: 10px;
     padding: 10px 20px;
     color: #fff;
     cursor: pointer;
     transition: 0.3s;
     min-width: 120px;
     display: flex;
     align-items: center;
     justify-content: center;
}

.lifeline-btn:hover:not(:disabled) {
     background: linear-gradient(to bottom, #1e2a40, #2e4c6b);
     border-color: #ffd700;
     transform: translateY(-2px);
}

.lifeline-btn:disabled {
     opacity: 0.5;
     cursor: not-allowed;
     border-color: #444;
     filter: grayscale(100%);
}

#lifeline-5050 {
     border-color: #ff9800;
}

#lifeline-comlink {
     border-color: #2196f3;
}

#lifeline-survey {
     border-color: #9c27b0;
}

.lifeline-icon {
     font-weight: bold;
     font-size: 1.1rem;
}

/* Difficulty Meter */
.difficulty-meter {
     display: flex;
     align-items: center;
     gap: 15px;
     background: rgba(0, 0, 0, 0.4);
     padding: 10px 20px;
     border-radius: 50px;
     margin-bottom: 20px;
     border: 1px solid #444;
}

.difficulty-label {
     color: #4caf50;
     font-weight: bold;
     font-family: monospace;
     font-size: 1.2rem;
}

.difficulty-bars {
     display: flex;
     gap: 4px;
     flex: 1;
}

.diff-bar {
     width: 8px;
     height: 20px;
     background: #333;
     border-radius: 2px;
}

.diff-bar.active {
     background: #4caf50;
     box-shadow: 0 0 5px #4caf50;
}

.diff-bar.active.medium {
     background: #ff9800;
     box-shadow: 0 0 5px #ff9800;
}

.diff-bar.active.hard {
     background: #f44336;
     box-shadow: 0 0 5px #f44336;
}

.question-box {
     background: rgba(0, 0, 0, 0.6);
     border: 2px solid #fff;
     border-radius: 50px;
     padding: 30px;
     text-align: center;
     font-size: 1.5rem;
     color: #fff;
     box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.answers-grid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 20px;
}

.millionaire-answer-btn {
     background: rgba(30, 42, 64, 0.8);
     /* Glassmorphism base */
     backdrop-filter: blur(10px);
     border: 1px solid rgba(102, 126, 234, 0.5);
     border-radius: 16px;
     /* Softer corners */
     padding: 16px;
     color: #e0e6ed;
     font-size: 1rem;
     cursor: pointer;
     text-align: left;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     position: relative;
     overflow: hidden;
     display: flex;
     align-items: flex-start;
     gap: 12px;
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.millionaire-answer-btn:hover:not(:disabled) {
     background: rgba(40, 55, 85, 0.9);
     border-color: #ffd700;
     transform: translateY(-2px);
     box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.millionaire-answer-btn:disabled {
     cursor: default;
}

.millionaire-answer-btn.correct {
     background: #4caf50;
     border-color: #4caf50;
     animation: flash 0.5s infinite;
}

.millionaire-answer-btn.wrong {
     background: #f44336;
     border-color: #f44336;
}

.millionaire-answer-btn.hidden-answer {
     opacity: 0;
     pointer-events: none;
}

.answer-letter {
     color: #ffd700;
     font-weight: 800;
     font-size: 1.2rem;
     line-height: 1.2;
     min-width: 24px;
     /* Fixed width for alignment */
     text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.answer-content {
     flex: 1;
     min-width: 0;
     color: #ffffff;
     /* Explicit bright white for text */
     font-weight: 500;
     line-height: 1.4;
}

.answer-content p {
     margin: 0;
}

.answer-content pre {
     background: rgba(0, 0, 0, 0.3);
     /* Subtle dark overlay */
     padding: 10px;
     border-radius: 6px;
     overflow-x: auto;
     margin: 6px 0;
     border: 1px solid rgba(255, 255, 255, 0.1);
     border-left: 3px solid #667eea;
     /* Accent border */
     text-align: left;
     max-width: 100%;
     box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.answer-content code {
     font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
     font-size: 0.85rem;
     color: #a5b3ce;
     /* Softer code color */
     line-height: 1.4;
}

.answer-content :not(pre)>code {
     background: rgba(255, 255, 255, 0.1);
     padding: 2px 5px;
     border-radius: 3px;
}

/* Lifeline Results */
.lifeline-result-area {
     background: rgba(0, 0, 0, 0.8);
     border: 1px solid #667eea;
     border-radius: 10px;
     padding: 15px;
     margin-top: 10px;
     color: #fff;
     text-align: center;
     animation: fadeIn 0.5s;
}

.comlink-message {
     font-size: 1.2rem;
     color: #2196f3;
}

.survey-chart {
     display: flex;
     justify-content: space-around;
     align-items: flex-end;
     height: 100px;
     padding-top: 10px;
}

.survey-bar-container {
     display: flex;
     flex-direction: column;
     align-items: center;
     width: 40px;
}

.survey-bar {
     width: 100%;
     background: #9c27b0;
     transition: height 1s ease-out;
     border-radius: 4px 4px 0 0;
}

.survey-label {
     margin-top: 5px;
     font-weight: bold;
     color: #ffd700;
}

.game-loader {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     display: none;
     flex-direction: column;
     align-items: center;
     gap: 15px;
     color: #fff;
     z-index: 10;
}

.spinner {
     width: 50px;
     height: 50px;
     border: 5px solid rgba(255, 255, 255, 0.3);
     border-top-color: #fff;
     border-radius: 50%;
     animation: spin 1s linear infinite;
}

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

@keyframes flash {
     0% {
          opacity: 1;
     }

     50% {
          opacity: 0.5;
     }

     100% {
          opacity: 1;
     }
}

@keyframes fadeIn {
     from {
          opacity: 0;
          transform: translateY(10px);
     }

     to {
          opacity: 1;
          transform: translateY(0);
     }
}

/* Custom Scrollbar for Millionaire Game */
.millionaire-main::-webkit-scrollbar {
     width: 8px;
}

.millionaire-main::-webkit-scrollbar-track {
     background: rgba(0, 0, 0, 0.3);
     border-radius: 4px;
}

.millionaire-main::-webkit-scrollbar-thumb {
     background: #667eea;
     border-radius: 4px;
}

.millionaire-main::-webkit-scrollbar-thumb:hover {
     background: #764ba2;
}

/* Explanation Box */
.explanation-box {
     background: rgba(0, 0, 0, 0.9);
     border: 2px solid #ffd700;
     border-radius: 15px;
     padding: 20px;
     margin-top: 20px;
     color: #fff;
     text-align: center;
     animation: slideUp 0.5s ease-out;
}

.explanation-title {
     color: #ffd700;
     font-weight: bold;
     font-size: 1.2rem;
     margin-bottom: 10px;
     text-transform: uppercase;
     letter-spacing: 1px;
}

#explanation-text {
     font-size: 1.1rem;
     line-height: 1.5;
     margin-bottom: 20px;
     color: #e0e0e0;
}

.next-btn {
     background: linear-gradient(45deg, #4caf50, #45a049);
     border: none;
     border-radius: 50px;
     padding: 12px 30px;
     color: #fff;
     font-size: 1.1rem;
     font-weight: bold;
     cursor: pointer;
     transition: 0.3s;
     box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.next-btn:hover {
     transform: scale(1.05);
     box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

@keyframes slideUp {
     from {
          opacity: 0;
          transform: translateY(20px);
     }

     to {
          opacity: 1;
          transform: translateY(0);
     }
}

/* Timer */
.game-status-bar {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin: 10px 0;
     padding: 0 10px;
     flex-wrap: wrap;
     gap: 10px;
}

.timer-container {
     position: relative;
     width: 60px;
     height: 60px;
     display: flex;
     justify-content: center;
     align-items: center;
     background: #2a2a3a;
     border-radius: 50%;
     border: 3px solid #667eea;
     box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.timer-text {
     font-size: 1.5rem;
     font-weight: bold;
     color: #fff;
}

.timer-warning {
     border-color: #ff4444;
     animation: pulse 1s infinite;
}

@keyframes pulse {
     0% {
          transform: scale(1);
     }

     50% {
          transform: scale(1.1);
     }

     100% {
          transform: scale(1);
     }
}

/* Second Chance Badge */
.second-chance-badge {
     background: linear-gradient(45deg, #ff9800, #ff5722);
     color: white;
     padding: 5px 15px;
     border-radius: 20px;
     font-weight: bold;
     font-size: 0.9rem;
     box-shadow: 0 2px 10px rgba(255, 87, 34, 0.4);
     animation: fadeIn 0.5s;
}

/* Markdown Content */
.question-box pre {
     background: #1e1e2e;
     padding: 15px;
     border-radius: 8px;
     overflow-x: auto;
     margin: 10px 0;
     border: 1px solid #444;
     text-align: left;
     white-space: pre;
     /* Keep pre for scrolling, pre-wrap for wrapping */
     max-width: 100%;
}

.question-box code {
     font-family: 'Consolas', 'Monaco', monospace;
     color: #a5b3ce;
     font-size: 0.95rem;
}

.question-box p {
     margin-bottom: 10px;
}

/* Sound Toggle Button */
.sound-toggle-btn {
     background: rgba(255, 255, 255, 0.1);
     border: 2px solid #667eea;
     border-radius: 50%;
     width: 50px;
     height: 50px;
     display: flex;
     justify-content: center;
     align-items: center;
     cursor: pointer;
     transition: all 0.3s ease;
     font-size: 1.5rem;
     box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.sound-toggle-btn:hover {
     background: rgba(102, 126, 234, 0.2);
     transform: scale(1.1);
     box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.sound-toggle-btn.muted {
     border-color: #ff4444;
     box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.sound-toggle-btn.muted:hover {
     background: rgba(255, 68, 68, 0.2);
     box-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
}

/* Links in explanations */
.explanation-box a {
     color: #667eea;
     text-decoration: underline;
     transition: color 0.3s;
}

.explanation-box a:hover {
     color: #ffd700;
}