/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
    text-align: center;
}

h2 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.5em;
}

h3 {
    color: #555;
    margin-bottom: 10px;
    font-size: 1.2em;
}

h4 {
    color: #333;
    margin-bottom: 8px;
}

p {
    margin-bottom: 15px;
}

ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
}

.content {
    margin-top: 20px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
    }

    10%,
    90% {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== PAGE MANAGEMENT ===== */
.page {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65418a 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn.download {
    background: #28a745;
}

.btn.download:hover {
    background: #218838;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ===== DOWNLOAD BUTTONS ===== */
.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.download-buttons .btn {
    flex: 1;
    min-width: 180px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-buttons .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.download-buttons .btn-primary:active {
    transform: translateY(0);
}

/* ===== FORM ELEMENTS ===== */
.question {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.question[data-answered="true"] {
    border-left-color: #28a745;
    background: #f0fff4;
}

.question label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label,
.checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.radio-group label:hover,
.checkbox-group label:hover {
    background: #e9ecef;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== SLIDER ===== */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.3s;
}

.slider::-webkit-slider-thumb:hover {
    background: #764ba2;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.slider::-moz-range-thumb:hover {
    background: #764ba2;
}

.slider-value {
    display: inline-block;
    margin-left: 15px;
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

/* ===== CONFIDENCE SECTION ===== */
.confidence-section {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    animation: slideIn 0.3s ease;
}

.confidence-section p {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

.confidence-section .slider {
    width: 100%;
    height: 8px;
    margin-bottom: 10px;
}

.confidence-value {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 10px;
}

/* ===== GAME PAGE ===== */
.game-info {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
}

.game-options button {
    min-height: 56px;
    padding: 16px 12px;
    font-size: 16px;
    margin: 8px 0;
}

.code-metadata {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 10px;
    background: #f0f4f8;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metadata-item strong {
    color: #333;
    font-weight: 600;
}

#game-code,
.code-preview {
    background: #ffffff !important;
    color: #333 !important;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 15px 0;
    border: 1px solid #ddd;
}

#game-code code,
.code-preview code {
    display: block;
    color: #333 !important;
    background: #ffffff !important;
}

/* Game code syntax highlighting */
#game-code .hljs,
.code-preview .hljs {
    background: #ffffff !important;
    color: #333 !important;
}

#game-code .hljs-string,
.code-preview .hljs-string {
    color: #50a14f !important;
}

#game-code .hljs-number,
.code-preview .hljs-number {
    color: #986801 !important;
}

#game-code .hljs-literal,
.code-preview .hljs-literal {
    color: #0184bc !important;
}

#game-code .hljs-attr,
.code-preview .hljs-attr {
    color: #4078f2 !important;
}

#game-code .hljs-variable,
.code-preview .hljs-variable {
    color: #e45649 !important;
}

#game-code .hljs-function,
.code-preview .hljs-function {
    color: #4078f2 !important;
}

#game-code .hljs-keyword,
.code-preview .hljs-keyword {
    color: #a626a4 !important;
}

#game-code .hljs-comment,
.code-preview .hljs-comment {
    color: #a0a1a7 !important;
    font-style: italic;
}

#game-code .hljs-title,
.code-preview .hljs-title {
    color: #4078f2 !important;
}

#game-code .hljs-name,
.code-preview .hljs-name {
    color: #e45649 !important;
}

#game-code .hljs-built_in,
.code-preview .hljs-built_in {
    color: #e45649 !important;
}

#game-code .hljs-symbol,
.code-preview .hljs-symbol {
    color: #50a14f !important;
}

.detail-item .code-preview {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    margin: 10px 0;
    overflow-x: auto;
}

/* Result code preview - for results page with syntax highlighting */
.result-code-preview {
    background: #ffffff !important;
    color: #333 !important;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
    border: 1px solid #ddd;
}

.result-code-preview code {
    display: block;
    color: #333 !important;
    background: #ffffff !important;
}

/* Syntax highlighting colors for results (atom-one-light theme) */
.result-code-preview .hljs {
    background: #ffffff !important;
    color: #333 !important;
}

.result-code-preview .hljs-string {
    color: #50a14f !important;
}

.result-code-preview .hljs-number {
    color: #986801 !important;
}

.result-code-preview .hljs-literal {
    color: #0184bc !important;
}

.result-code-preview .hljs-attr {
    color: #4078f2 !important;
}

.result-code-preview .hljs-variable {
    color: #e45649 !important;
}

.result-code-preview .hljs-function {
    color: #4078f2 !important;
}

.result-code-preview .hljs-keyword {
    color: #a626a4 !important;
}

.result-code-preview .hljs-comment {
    color: #a0a1a7 !important;
    font-style: italic;
}

.result-code-preview .hljs-title {
    color: #4078f2 !important;
}

.result-code-preview .hljs-name {
    color: #e45649 !important;
}

.result-code-preview .hljs-built_in {
    color: #e45649 !important;
}

.result-code-preview .hljs-symbol {
    color: #50a14f !important;
}

pre {
    margin: 0;
}

.explanation {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.explanation strong {
    color: #667eea;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ===== RESULTS PAGE ===== */
.results-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.stat {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 30px;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #555;
    min-width: 0;
    word-break: break-word;
}

.stat-value {
    font-weight: bold;
    font-size: 20px;
    color: #667eea;
    text-align: right;
    white-space: nowrap;
    animation: countUp 0.5s ease-out;
}

.stats-box {
    padding: 12px;
    margin: 10px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* ===== COMPARISON & TIMING BOXES ===== */
.comparison-box,
.timing-box,
.extended-metrics-box {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.timing-box {
    background: #fff5f5;
    border-left-color: #ffc107;
}

.extended-metrics-box {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

.comparison-box h3,
.timing-box h3,
.extended-metrics-box h3 {
    margin-top: 0;
    color: #667eea;
}

.timing-box h3 {
    color: #f59e0b;
}

.extended-metrics-box h3 {
    color: #7b1fa2;
}

.timing-tooltip {
    position: relative;
    cursor: help;
}

.timing-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 1000;
}

/* ===== RECOMMENDATIONS ===== */
.recommendation {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.recommendation h3 {
    color: #856404;
    margin-bottom: 10px;
}

.recommendation p {
    color: #856404;
    margin: 0;
}

/* ===== GAME DETAILS ===== */
.game-details {
    margin-top: 30px;
}

.detail-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ddd;
}

.detail-item.correct {
    border-left-color: #28a745;
}

.detail-item.mistake {
    border-left-color: #dc3545;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.badge.buggy {
    background: #dc3545;
    color: white;
}

.badge.correct {
    background: #28a745;
    color: white;
}

.badge.user-nein {
    background: #dc3545;
    color: white;
}

.badge.user-ja {
    background: #28a745;
    color: white;
}

.badge.user-aendern {
    background: #ffc107;
    color: #333;
}

.badge.mistake {
    background: #dc3545;
    color: white;
}

/* ===== CHARTS ===== */
#results-chart {
    display: block;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    max-width: 100%;
    height: auto;
}

/* ===== KEYBOARD HINT ===== */
.keyboard-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

/* ===== LOADING ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-container {
    max-width: 1400px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.admin-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 15px 0;
}

.admin-stat-label {
    font-size: 0.95em;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TOOLTIP ===== */
button[title],
p[title] {
    cursor: help;
    position: relative;
}

button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

button[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #667eea;
    color: white;
}

/* ===== SECURITY TIP & FEEDBACK ===== */
.security-tip {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    animation: slideIn 0.3s ease-in;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

.security-tip h4 {
    margin: 0 0 12px 0;
    color: #1565c0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.security-tip h4::before {
    content: "💡";
    margin-right: 8px;
    font-size: 18px;
}

.security-tip p {
    margin: 0;
    color: #0d47a1;
    font-size: 14px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 3px;
    margin-top: 8px;
}

.submission-feedback {
    text-align: center;
    padding: 12px;
    margin: 15px 0;
    background: #e8f5e9;
    border-radius: 4px;
    color: #2e7d32;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    margin-bottom: 15px;
    color: #333;
}

.code-textarea {
    width: 100%;
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.code-textarea:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    margin: 0;
}

/* Modal code editor split view */
.modal-code-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: 100%;
}

.editor-section,
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.code-textarea {
    flex: 1;
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #ffffff;
    color: #333;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
}

.code-textarea:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.code-preview-highlight {
    flex: 1;
    background: #ffffff !important;
    color: #333 !important;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    overflow: auto;
}

/* Syntax highlighting for code preview */
.code-preview-highlight .hljs {
    background: #ffffff !important;
    color: #333 !important;
}

.code-preview-highlight .hljs-string {
    color: #50a14f !important;
}

.code-preview-highlight .hljs-number {
    color: #986801 !important;
}

.code-preview-highlight .hljs-literal {
    color: #0184bc !important;
}

.code-preview-highlight .hljs-attr {
    color: #4078f2 !important;
}

.code-preview-highlight .hljs-variable {
    color: #e45649 !important;
}

.code-preview-highlight .hljs-function {
    color: #4078f2 !important;
}

.code-preview-highlight .hljs-keyword {
    color: #a626a4 !important;
}

.code-preview-highlight .hljs-comment {
    color: #a0a1a7 !important;
    font-style: italic;
}

.code-preview-highlight .hljs-title {
    color: #4078f2 !important;
}

.code-preview-highlight .hljs-name {
    color: #e45649 !important;
}

.code-preview-highlight .hljs-built_in {
    color: #e45649 !important;
}

.code-preview-highlight .hljs-symbol {
    color: #50a14f !important;
}

/* Responsive modal code editor */
@media (max-width: 768px) {
    .modal-code-editor {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .button-group,
    .keyboard-hint,
    #loading,
    .download-buttons {
        display: none !important;
    }

    .page {
        display: block !important;
    }

    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }
}

/* ===== TABLET RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        margin: 10px;
    }

    .page {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .stat {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 15px;
    }

    .progress-container {
        margin: 15px 0 8px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    #results-chart {
        width: 100%;
        height: auto;
    }

    .comparison-box,
    .timing-box {
        padding: 15px;
    }

    .keyboard-hint {
        display: none;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-buttons .btn {
        width: 100%;
        min-width: auto;
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 600px) {
    .btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }

    .btn-primary {
        padding: 14px 20px;
    }

    .question {
        padding: 16px;
        margin: 12px 0;
    }

    .question label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px;
        padding: 12px;
        min-height: 44px;
    }

    input[type="radio"],
    input[type="checkbox"] {
        min-width: 24px;
        min-height: 24px;
        margin: 8px 10px 8px 0;
    }

    label {
        display: inline-block;
        padding: 8px;
    }

    .game-options button {
        min-height: 56px;
        padding: 16px 12px;
        font-size: 16px;
        margin: 8px 0;
    }

    table {
        font-size: 14px;
    }

    td,
    th {
        padding: 10px 6px;
    }

    .progress-container {
        margin: 16px 0;
    }

    .progress-bar {
        height: 8px;
    }

    canvas {
        max-width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    p {
        font-size: 15px;
        line-height: 1.5;
    }

    .results-container {
        padding: 12px;
    }

    .stats-box {
        padding: 12px;
        margin: 10px 0;
    }

    .keyboard-hint {
        display: none;
    }

    /* Mobile-optimized code display */
    #game-code {
        font-size: 11px;
        padding: 12px;
        line-height: 1.4;
        overflow-x: auto;
        word-wrap: break-word;
        overflow-wrap: break-word;
        background: #f5f5f5;
        max-height: 300px;
    }

    .code-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .security-tip {
        margin: 12px 0;
        padding: 10px;
        font-size: 13px;
    }

    .security-tip h4 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .security-tip p {
        font-size: 12px;
    }

    .submission-feedback {
        font-size: 14px;
        padding: 10px;
    }
}