/* Game Engine Styles */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: white;
    transition: opacity 0.3s ease;
}

.game-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.level-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.level-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
    min-height: 0;
}

.question-container {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-height: 120px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
}

.question-text {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.question-visual {
    font-size: 2rem;
    margin: 1rem 0;
}

.answer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
}

.answer-option {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 1.5rem 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option:hover {
    background: white;
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.answer-option:active {
    transform: translateY(0);
}

.game-controls {
    display: flex;
    gap: 1rem;
}

.btn-hint {
    background: var(--accent-gold);
    color: white;
}

.btn-pause {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Game Feedback Styles */
.game-feedback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.3s ease;
}

.feedback-content {
    background: white;
    color: var(--text-dark);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.feedback-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.game-feedback.success .feedback-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.game-feedback.error .feedback-content {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Level Complete Styles */
.level-complete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.5s ease;
}

.complete-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 25px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.complete-stars {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out;
}

.complete-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent-gold);
}

.complete-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
}

.complete-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.complete-stats .stat span:first-child {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.complete-stats .stat span:last-child {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.complete-rewards {
    margin-bottom: 2rem;
}

.complete-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* World Level Selection Styles */
.world-levels-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.world-levels-content {
    padding: 0;
}

.modal-header {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.modal-header p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.world-progress-summary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
}

.world-progress-summary .progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.world-progress-summary .progress-fill {
    background: var(--accent-gold);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.level-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px solid transparent;
}

.level-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.level-card.locked {
    opacity: 0.6;
    background: rgba(200, 200, 200, 0.3);
}

.level-card.completed {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.level-number {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.level-card.completed .level-number {
    background: var(--success);
}

.level-info {
    flex: 1;
}

.level-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.level-type {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.level-stars {
    font-size: 1.1rem;
}

.level-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    margin: 0.5rem 0;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.level-card.locked {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.5);
}

.level-card.completed {
    background: rgba(46, 213, 115, 0.1);
    border-color: var(--success);
}

.level-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.level-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.level-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--primary);
    font-size: 1rem;
}

.level-type {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.level-rating {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.level-stars {
    font-size: 1.2rem;
    text-align: center;
    padding: 0.25rem 0;
}

.level-actions {
    display: flex;
    justify-content: center;
}

.level-play-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* World preview modal performance optimization styles */
.world-preview-styled {
    max-width: 600px;
    text-align: center;
}

.world-preview-header-styled {
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
    color: white;
    margin: -2rem -2rem 1.5rem -2rem;
}

.world-preview-icon-styled {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Drag and Sort Styles */
.drag-instructions {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 500;
}

.sort-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    min-height: 80px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.sort-item {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.sort-item:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Visual Components */
.comparison-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
}

.number-group {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    min-width: 100px;
    text-align: center;
}

.vs {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.place-value-visual {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.tens-column, .ones-column {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid var(--primary);
}

.column-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.blocks {
    font-size: 1.5rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.odd-even-visual {
    text-align: center;
}

.number-display {
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.dots {
    font-size: 1.5rem;
    margin: 1rem 0;
    line-height: 1.2;
}

.pairs {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

.number-line-visual {
    width: 100%;
    overflow-x: auto;
    padding: 1rem;
}

.number-line {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    min-width: 500px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 2px solid var(--primary);
}

.number-point {
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-point:hover {
    background: var(--accent-gold);
    transform: scale(1.1);
}

.number-point.hidden {
    background: rgba(200, 200, 200, 0.5);
    color: transparent;
    border: 2px dashed var(--primary);
    cursor: pointer;
}

.number-point.hidden::before {
    content: '?';
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.estimation-visual {
    position: relative;
    width: 350px;
    height: 250px;
    margin: 1rem auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 2px solid var(--primary);
    overflow: hidden;
}

.estimation-object {
    font-size: 1.2rem;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Training Arena Styles */
.training-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.practice-modal-content {
    padding: 0;
}

.practice-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.practice-mode-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
}

.practice-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.mode-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.mode-info p {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.world-badge {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.practice-settings {
    background: rgba(247, 250, 252, 0.8);
    padding: 2rem;
    border-top: 1px solid var(--border);
}

.practice-settings h3 {
    margin: 0 0 1.5rem 0;
    color: var(--primary);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.settings-row label {
    font-weight: 500;
    color: var(--text-dark);
}

.settings-row select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
}

.settings-row select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Challenge Modal Styles */
.challenge-modal .modal-content {
    max-width: 700px;
}

.challenge-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
}

.challenge-timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 1rem;
    font-weight: 600;
}

.current-challenge {
    padding: 2rem;
}

.challenge-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.challenge-card h3 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.challenge-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.challenge-progress h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.progress-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.progress-stats .stat {
    text-align: center;
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: 10px;
    flex: 1;
}

.progress-stats .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.progress-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.challenge-rewards h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.reward-tier {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.reward-tier:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.tier-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tier-name {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.tier-reward {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.challenge-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Mixed Operations Modal */
.mixed-modal .modal-content {
    max-width: 600px;
}

.mixed-settings {
    padding: 2rem;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.world-selection {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.world-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.world-checkbox:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
}

.world-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.special-modes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

/* Training-specific game elements */
.challenge-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.challenge-target {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 1.1rem;
}

.survival-lives {
    color: var(--error) !important;
}

.survival-lives .stat-value {
    color: var(--error) !important;
    font-size: 1.5rem;
}

/* Additional visual styles for training questions */
.addition-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.addition-visual .number-group {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--success);
}

.addition-visual .operator,
.addition-visual .equals {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.addition-visual .result {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
}

.subtraction-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.subtraction-visual .original {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--success);
}

.subtraction-visual .taken {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--error);
}

.subtraction-visual .operator,
.subtraction-visual .equals {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.subtraction-visual .result {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--primary);
}

.multiplication-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.multiplication-visual .group {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    color: var(--accent-gold);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .level-stats {
        gap: 1rem;
    }
    
    .game-area {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 1.4rem;
    }
    
    .answer-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .answer-option {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .level-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .comparison-visual {
        flex-direction: column;
        gap: 1rem;
    }
    
    .place-value-visual {
        flex-direction: column;
        gap: 1rem;
    }
    
    .complete-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .complete-actions {
        flex-direction: column;
    }
}

/* ===== FINAL BOSS STYLES ===== */
.boss-hp-container {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.boss-hp-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.boss-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.boss-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.boss-hp-bar-container {
    flex: 1;
    margin: 0 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 3px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.boss-hp-bar {
    height: 20px;
    background: linear-gradient(90deg, #ff4757 0%, #ff6b7a 50%, #ff4757 100%);
    border-radius: 8px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.boss-hp-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    border-radius: 8px;
    animation: hp-pulse 2s infinite;
}

@keyframes hp-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.boss-hp-text {
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    min-width: 80px;
    text-align: center;
}

.boss-phase-stat, .boss-combo-stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid var(--accent-gold);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.boss-phase-stat .stat-label::before {
    content: "⚡ ";
}

.boss-combo-stat .stat-label::before {
    content: "🔥 ";
}

/* Final Boss Question Styles */
.final-boss-question {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.final-boss-question::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: mystical-aura 4s infinite linear;
    pointer-events: none;
}

@keyframes mystical-aura {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.boss-phase-indicator {
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--accent-gold);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ===== LEGENDARY LOOT STYLES ===== */
.loot-chest-modal {
    background: rgba(0, 0, 0, 0.9);
}

.loot-chest-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    max-width: 500px;
    position: relative;
    overflow: hidden;
}

.chest-opening-sequence {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.chest-animation {
    font-size: 8rem;
    margin: 2rem 0;
    position: relative;
    display: inline-block;
    animation: chest-bounce 2s infinite ease-in-out;
}

@keyframes chest-bounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.chest-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 1.5s infinite alternate;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes glow-pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.loot-reveal {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-gold);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
}

.loot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.loot-item.common {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border: 2px solid #a0aec0;
    color: #2d3748;
}

.loot-item.rare {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    border: 2px solid #63b3ed;
    color: white;
}

.loot-item.epic {
    background: linear-gradient(135deg, #805ad5 0%, #553c9a 100%);
    border: 2px solid #b794f6;
    color: white;
}

.loot-item.legendary {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    border: 2px solid var(--accent-gold);
    color: white;
    animation: legendary-sparkle 3s infinite;
    position: relative;
    overflow: hidden;
}

@keyframes legendary-sparkle {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.3); }
}

.loot-item.legendary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: legendary-sweep 2s infinite;
}

@keyframes legendary-sweep {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.loot-item-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.loot-item-info {
    flex: 1;
}

.loot-item-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.loot-item-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

.loot-item-value {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== CHALLENGE STAGES ENHANCEMENTS ===== */
.challenge-stage-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.challenge-stage-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: challenge-sweep 3s infinite;
}

@keyframes challenge-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.challenge-stage-title {
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.challenge-stage-subtitle {
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: 600;
}

.wave-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
    backdrop-filter: blur(5px);
}

.wave-progress {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wave-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--accent-gold);
    transition: all 0.3s ease;
}

.wave-dot.completed {
    background: var(--success);
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
}

.wave-dot.current {
    background: var(--accent-gold);
    animation: wave-pulse 1.5s infinite;
    transform: scale(1.2);
}

@keyframes wave-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* Challenge Stage Completion */
.challenge-complete-screen {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.challenge-complete-title {
    font-size: 2.5rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
    animation: victory-glow 2s infinite alternate;
}

@keyframes victory-glow {
    0% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); }
    100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 20px var(--accent-gold); }
}

.challenge-rewards-earned {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.challenge-reward-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid var(--accent-gold);
}

/* ===== TRAINING ARENA ENHANCEMENTS ===== */
.training-mode-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.training-mode-title {
    font-size: 1.8rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.training-session-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
    backdrop-filter: blur(5px);
}

.training-stat {
    text-align: center;
    color: white;
}

.training-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    display: block;
}

.training-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weekly Challenge Styles */
.weekly-challenge-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.weekly-challenge-banner::after {
    content: '🏆';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    animation: trophy-rotate 3s infinite linear;
}

@keyframes trophy-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.weekly-challenge-title {
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
}

.challenge-tier-rewards {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    gap: 1rem;
}

.tier-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
}

.tier-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
    border-color: #cd7f32;
    color: white;
}

.tier-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    border-color: #c0c0c0;
    color: #333;
}

.tier-badge.gold {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8860b 100%);
    border-color: var(--accent-gold);
    color: #333;
    animation: gold-shine 2s infinite alternate;
}

@keyframes gold-shine {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* ===== COUNTING VISUAL STYLES ===== */
.counting-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 1rem 0 2rem 0;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-height: 40vh;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.counting-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 0.5rem 0;
}

.counting-object {
    font-size: 2.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: counting-bounce 0.5s ease-out;
}

.counting-object:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

@keyframes counting-bounce {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(-90deg); opacity: 0.8; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Estimation Visual (existing, but enhanced) */
.estimation-visual {
    position: relative;
    height: 250px;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 178, 172, 0.1) 100%);
    border-radius: 15px;
    margin: 1rem 0;
    border: 2px solid rgba(72, 187, 120, 0.3);
    overflow: hidden;
}

.estimation-object {
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: estimation-float 3s infinite ease-in-out;
}

.estimation-object:nth-child(odd) {
    animation-delay: -1.5s;
}

@keyframes estimation-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Medium screen level card responsiveness */
@media (max-width: 992px) {
    .level-card {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .level-play-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .level-info h4 {
        font-size: 0.9rem;
    }
    
    .level-type {
        font-size: 0.8rem;
    }
}

/* Enhanced Mobile Responsiveness for New Components */
@media (max-width: 768px) {
    .boss-hp-container {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
    
    .boss-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .boss-name {
        font-size: 1.2rem;
    }
    
    .boss-hp-bar-container {
        margin: 0;
        width: 100%;
    }
    
    .chest-animation {
        font-size: 6rem;
        margin: 1rem 0;
    }
    
    .loot-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .challenge-stage-title {
        font-size: 1.5rem;
    }
    
    .challenge-complete-title {
        font-size: 2rem;
    }
    
    .challenge-tier-rewards {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .training-session-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .weekly-challenge-banner {
        padding: 1.5rem;
    }
    
    .weekly-challenge-title {
        font-size: 1.5rem;
    }
    
    .counting-visual {
        padding: 1rem;
        gap: 0.75rem;
        max-height: 35vh;
        margin: 0.5rem 0 1.5rem 0;
    }
    
    .counting-row {
        gap: 1rem;
    }
    
    .counting-object {
        font-size: 2rem;
        min-width: 50px;
        min-height: 50px;
        padding: 0.25rem;
    }
    
    .question-container {
        max-height: 60vh;
        padding: 1.5rem;
    }
    
    .estimation-visual {
        height: 200px;
    }
    
    .estimation-object {
        font-size: 1.5rem;
    }
    
    /* Level card mobile responsiveness */
    .level-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .level-info {
        width: 100%;
    }
    
    .level-rating {
        width: 100%;
        gap: 0.75rem;
    }
    
    .level-actions {
        width: 100%;
    }
    
    .level-play-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}