* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.card-full-width {
    max-width: 100% !important;
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* V7.0: Game Mode Selector Styles */
.game-mode-selector {
    margin: 20px 0;
}

.mode-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.mode-option.active {
    border-color: #667eea;
    background: #e8f0fe;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.mode-icon {
    font-size: 2rem;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

.mode-details h5 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

/* V12: Duration Selector Styles */
.duration-selector {
    margin: 15px 0;
}

.duration-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 70px;
    background: white;
}

.duration-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.duration-option.active {
    border-color: #667eea;
    background: #e8f0fe;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.duration-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.duration-option small {
    color: #666;
    font-size: 0.8rem;
}

.mode-details p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* V13: Old Game Mode Radio Selector - REMOVED - Now using simple .game-mode-option style */

/* V13: Compact Duration Selector */
.duration-selector-compact .duration-option-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 40px;
}

.duration-selector-compact .duration-option-compact:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-1px);
}

.duration-selector-compact .duration-option-compact.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* V7.0: Discovery Animation Styles */
.discovery-animation {
    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: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.discovery-animation.animate {
    opacity: 1;
}

.discovery-animation.fade-out {
    opacity: 0;
}

.discovery-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.5s ease;
}

.discovery-animation.animate .discovery-content {
    transform: scale(1);
}

.discovery-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.discovery-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 2rem;
}

.discovery-content h4 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.5rem;
}

.discovery-points {
    background: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    margin: 10px 0;
}

.discovery-sparkles {
    font-size: 1.5rem;
    margin-top: 15px;
    opacity: 0.8;
}

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

/* V7.0: Clue Panel Styles */
.clue-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid #f39c12;
}

.clue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e1e1;
}

.clue-header h4 {
    margin: 0;
    color: #f39c12;
}

.discovery-progress {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

.current-clue {
    margin: 15px 0;
}

.current-clue p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #333;
    font-weight: 500;
    margin: 0;
}

/* Proximity Feedback */
.proximity-feedback {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.proximity-bar {
    width: 100%;
    height: 8px;
    background: #e1e1e1;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.proximity-progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Server Selector Styles */
.server-list {
    max-height: 200px;
    overflow-y: auto;
}

.server-option {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.server-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.server-option .card-body {
    padding: 12px !important;
}

/* Hint Section */
.hint-section {
    margin: 15px 0;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
}

.hint-text {
    margin: 0;
    color: #856404;
    font-style: italic;
}

/* Clue Actions */
.clue-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.clue-actions .btn {
    flex: 1;
}

/* V7.0: Tower Selection Panel Styles */
.tower-selector-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid #3498db;
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e1e1;
}

.selector-header h4 {
    margin: 0;
    color: #3498db;
}

.tower-selection-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.tower-selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.tower-selection-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.tower-selection-item.discovered {
    border-color: #27ae60;
    background: #f0f9f0;
}

.tower-selection-item.captured {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.tower-selection-item.selected {
    border-color: #f39c12;
    background: #fff8e1;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.tower-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tower-status-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.tower-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.tower-distance {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.tower-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tower-status.available {
    color: #3498db;
}

.tower-status.discovered {
    color: #27ae60;
}

.tower-status.captured {
    color: #e74c3c;
}

.selector-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* Mobile Optimizations for Tower Selection */
@media (max-width: 768px) {
    .tower-selector-panel {
        margin: 5px 0;
        padding: 15px;
    }
    
    .selector-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tower-selection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tower-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .tower-distance {
        text-align: right;
    }
}

/* Mobile Optimizations for Clue Panel */
@media (max-width: 768px) {
    .clue-panel {
        margin: 5px 0;
        padding: 15px;
    }
    
    .clue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .clue-actions {
        flex-direction: column;
    }
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 10px 0;
    min-height: 50px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.form-group {
    margin: 20px 0;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.session-code {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    letter-spacing: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.team-list {
    margin: 20px 0;
    text-align: left;
}

.team-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.team-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.team-name {
    font-weight: 600;
    flex: 1;
}

.host-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.waiting-message {
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

.config-selector {
    margin: 20px 0;
}

.config-option {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.config-option:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.config-option.selected {
    border-color: #667eea;
    background: #e8f0fe;
}

.config-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.config-description {
    color: #666;
    font-size: 0.9rem;
}

/* Game Mode Selector - Simple Style (same as config-option) */
.game-mode-selector {
    margin: 20px 0;
}

.game-mode-option {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.game-mode-option:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.game-mode-option.selected {
    border-color: #667eea;
    background: #e8f0fe;
}

.game-mode-option .mode-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.game-mode-option .mode-description {
    color: #666;
    font-size: 0.8rem;
    margin: 0;
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.2);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.game-map {
    width: 100%;
    height: 60vh;
    border-radius: 10px;
    margin-bottom: 20px;
}

.game-controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.score-item {
    text-align: center;
    flex: 1;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
        max-width: 100%;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .session-code {
        font-size: 2.5rem;
        letter-spacing: 3px;
    }
    
    .game-map {
        height: 50vh;
    }
    
    .scoreboard {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-item {
        background: #f8f9fa;
        padding: 10px;
        border-radius: 5px;
    }
}

@media (max-width: 480px) {
    .session-code {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .team-item {
        padding: 10px;
    }
    
    .color-option {
        width: 35px;
        height: 35px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn {
    flex: 1;
    margin: 0;
}

.gps-option {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    text-align: left;
    border: 2px solid #e1e1e1;
}

.gps-option h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.gps-option p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.gps-option ul {
    margin: 10px 0 15px 20px;
    color: #666;
}

.gps-option .btn {
    width: auto;
    min-width: 120px;
    padding: 10px 20px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .gps-option {
        padding: 15px;
    }
}

/* GPS Center Button */
.gps-center-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #667eea;
    color: white;
    border: 3px solid white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.gps-center-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.gps-center-button:active {
    transform: scale(0.95);
}

.gps-center-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .gps-center-button {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .gps-center-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        border-width: 2px;
    }
}

/* V6.0: Map Legend Styling */
.map-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    min-width: 140px;
}

.map-legend h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 2px 0;
}

.legend-icon {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.legend-icon.owned {
    color: #f39c12;
}

.legend-icon.enemy {
    color: #e74c3c;
}

.legend-icon.neutral {
    color: #7f8c8d;
}

.legend-text {
    color: #333;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Mobile responsiveness for map legend */
@media (max-width: 768px) {
    .map-legend {
        font-size: 0.8rem;
        padding: 12px;
        min-width: 120px;
        bottom: 8px;
        left: 8px;
    }
    
    .map-legend h4 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .legend-item {
        margin: 6px 0;
    }
    
    .legend-icon {
        font-size: 1.1rem;
        width: 18px;
        margin-right: 8px;
    }
    
    .legend-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .map-legend {
        font-size: 0.75rem;
        padding: 10px;
        min-width: 110px;
        bottom: 60px; /* Move up to avoid GPS button */
        left: 5px;
    }
    
    .map-legend h4 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .legend-item {
        margin: 5px 0;
    }
    
    .legend-icon {
        font-size: 1rem;
        width: 16px;
        margin-right: 6px;
    }
    
    .legend-text {
        font-size: 0.75rem;
    }
}

/* V6.0: Quiz Container - Mobile-Optimized Styling */
.quiz-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid #667eea;
    position: relative;
}

.quiz-content {
    text-align: center;
}

.quiz-content h4 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.quiz-question {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 15px 0 20px 0;
    color: #333;
    font-weight: 500;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.quiz-input-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    align-items: stretch;
}

.quiz-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 50px;
}

.quiz-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quiz-submit {
    padding: 12px 20px;
    min-width: 100px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    min-height: 50px;
}

.quiz-feedback {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}

.quiz-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quiz-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* V6.0: Enhanced feedback styles for intelligent answer validation */
.quiz-feedback.cooldown {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.quiz-feedback.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* V6.0: Hint styling within error messages */
.quiz-feedback small {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.3;
}

/* V6.0: Cooldown button styling */
.quiz-submit.cooldown {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.quiz-submit.cooldown:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
}

/* V6.0: Disabled input during cooldown */
.quiz-input:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
    cursor: not-allowed;
}

.quiz-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.quiz-actions .btn {
    min-width: 120px;
    margin: 0 5px;
}

/* Mobile Optimizations for Quiz Container */
@media (max-width: 768px) {
    .quiz-container {
        margin: 10px 0;
        padding: 18px;
        border-radius: 12px;
    }
    
    .quiz-content h4 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .quiz-question {
        font-size: 1rem;
        padding: 12px;
        margin: 12px 0 18px 0;
    }
    
    .quiz-input-group {
        flex-direction: column;
        gap: 12px;
        margin: 18px 0;
    }
    
    .quiz-input {
        padding: 15px;
        font-size: 1.1rem;
        min-height: 55px;
    }
    
    .quiz-submit {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
        min-height: 55px;
    }
    
    .quiz-feedback {
        margin: 12px 0;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .quiz-actions {
        margin-top: 12px;
    }
    
    .quiz-actions .btn {
        width: 100%;
        margin: 5px 0;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        margin: 8px 0;
        padding: 15px;
        border-radius: 10px;
    }
    
    .quiz-content h4 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .quiz-question {
        font-size: 0.95rem;
        padding: 10px;
        margin: 10px 0 15px 0;
        line-height: 1.4;
    }
    
    .quiz-input {
        padding: 12px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .quiz-submit {
        padding: 12px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .quiz-feedback {
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* V6.0: Enhanced Touch Interactions for Mobile */
@media (max-width: 768px) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 50px;
        padding: 15px 25px;
        font-size: 1.1rem;
        touch-action: manipulation; /* Prevents double-tap zoom */
    }
    
    .form-control {
        min-height: 50px;
        padding: 15px;
        font-size: 1.1rem;
        touch-action: manipulation;
    }
    
    /* Enhanced team item touch targets */
    .team-item {
        min-height: 60px;
        padding: 15px;
        cursor: pointer;
        touch-action: manipulation;
    }
    
    /* Improved color picker for touch */
    .color-option {
        width: 45px;
        height: 45px;
        margin: 5px;
        touch-action: manipulation;
    }
    
    /* Better session code display touch area */
    .session-code {
        padding: 15px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        margin: 15px 0;
        user-select: all; /* Allows easy copying */
        cursor: pointer;
        touch-action: manipulation;
    }
    
    /* Enhanced scoreboard touch targets */
    .score-item {
        min-height: 70px;
        padding: 15px 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        touch-action: manipulation;
    }
    
    /* Better map legend touch interaction */
    .map-legend {
        touch-action: none; /* Prevents map interaction when touching legend */
        user-select: none;
    }
    
    /* GPS center button enhanced for touch */
    .gps-center-button {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - even larger touch targets */
    .btn {
        min-height: 55px;
        padding: 18px 25px;
        font-size: 1.1rem;
    }
    
    .form-control {
        min-height: 55px;
        padding: 18px;
        font-size: 1.1rem;
    }
    
    .color-option {
        width: 50px;
        height: 50px;
        margin: 8px;
    }
    
    .score-item {
        min-height: 75px;
        padding: 18px 12px;
    }
    
    .gps-center-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* V6.0: Enhanced Responsive Design Improvements */

/* Landscape phone orientation optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .game-map {
        height: 45vh; /* Reduce map height in landscape */
    }
    
    .quiz-container {
        padding: 10px;
        margin: 8px 0;
    }
    
    .quiz-question {
        font-size: 0.9rem;
        padding: 8px;
        margin: 8px 0 12px 0;
    }
    
    .scoreboard {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .map-legend {
        bottom: 5px;
        left: 5px;
        padding: 8px;
        font-size: 0.7rem;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 800px;
        padding: 20px;
    }
    
    .game-map {
        height: 65vh;
    }
    
    .scoreboard {
        display: flex;
        justify-content: space-around;
        margin-bottom: 20px;
    }
    
    .score-item {
        flex: 1;
        max-width: 150px;
        margin: 0 10px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 10px;
    }
    
    .quiz-container {
        max-width: 600px;
        margin: 20px auto;
    }
    
    .quiz-input-group {
        max-width: 500px;
        margin: 20px auto;
    }
}

/* Large screens optimizations */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        padding: 30px;
    }
    
    .game-map {
        height: 70vh;
        border-radius: 15px;
    }
    
    .quiz-container {
        max-width: 700px;
        margin: 25px auto;
        padding: 30px;
    }
    
    .quiz-question {
        font-size: 1.2rem;
        padding: 20px;
    }
    
    .quiz-input-group {
        max-width: 600px;
        margin: 25px auto;
    }
    
    .quiz-input {
        font-size: 1.1rem;
        padding: 15px 20px;
    }
    
    .quiz-submit {
        font-size: 1.1rem;
        padding: 15px 30px;
        min-width: 150px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .game-map {
        height: 75vh;
    }
    
    .quiz-container {
        max-width: 800px;
        padding: 35px;
    }
}

/* High DPI / Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gps-center-button {
        border-width: 2px;
    }
    
    .quiz-container {
        border-width: 1px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    }
    
    .map-legend {
        border: 1px solid rgba(0,0,0,0.1);
    }
}

/* Print styles (for potential sharing/debugging) */
@media print {
    .gps-center-button,
    .map-legend,
    .quiz-container {
        display: none;
    }
    
    .game-map {
        height: 40vh;
        border: 1px solid #ccc;
    }
    
    .scoreboard {
        page-break-inside: avoid;
    }
}

/* Desktop Layout Consistency - Main Container Responsive Design */
/* Tablet responsive behavior */
@media (min-width: 769px) and (max-width: 991px) {
    #main-container {
        max-width: 700px;
        margin: 0 auto;
    }
    
    /* Ensure cards maintain proper width and spacing */
    #main-container .card.shadow.card-full-width {
        max-width: 100%;
        width: 100%;
    }
    
    /* Ensure all shadow cards maintain proper width and spacing in main-container */
    #main-container .card.shadow.mb-3 {
        max-width: 100%;
        width: 100%;
    }
    
    /* Ensure consistent padding for card bodies */
    #main-container .card-body {
        padding: 1rem !important;
    }
}

/* Desktop layout improvements */
@media (min-width: 992px) {
    /* Limit container width on desktop and center content - same as game.html */
    #main-container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Ensure cards maintain proper width and spacing */
    #main-container .card.shadow.card-full-width {
        max-width: 100%;
        width: 100%;
    }
    
    /* Ensure all shadow cards maintain proper width and spacing in main-container */
    #main-container .card.shadow.mb-3 {
        max-width: 100%;
        width: 100%;
    }
    
    /* Ensure consistent padding for card bodies */
    #main-container .card-body {
        padding: 1rem !important;
    }
    
    /* Improve spacing for large screens */
    #main-container .logo {
        font-size: 2.8rem;
    }
    
    #main-container .subtitle {
        font-size: 1.2rem;
        margin-bottom: 35px;
    }
    
    /* Better button spacing on desktop */
    #main-container .d-grid.gap-3 {
        gap: 1.5rem !important;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Mobile Action Buttons - Refresh și Ieși */
.btn-mobile-action {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 4px;
    min-height: 40px;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline: none;
}

.btn-mobile-action:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-mobile-action:active {
    transform: translateY(0);
}

.btn-mobile-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Mobile optimizations for action buttons */
@media (max-width: 768px) {
    .btn-mobile-action {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 48px;
        min-width: 100px;
        margin: 0 6px;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    .btn-mobile-action {
        padding: 14px 22px;
        font-size: 1.1rem;
        min-height: 50px;
        min-width: 110px;
        margin: 0 8px;
    }
}