body { font-family: Arial, sans-serif; display: flex; flex-direction: column; align-items: center; min-height: 100vh; background-color: #f4f4f9; margin: 0; padding: 20px; box-sizing: border-box; overflow-x: hidden; }

.bg-equations { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: space-around; align-content: space-around; color: rgba(0, 0, 0, 0.1); font-size: 28px; font-family: 'Times New Roman', Times, serif; font-style: italic; user-select: none; }
.bg-equations span { margin: 40px; transform: rotate(-15deg); }

.game-container { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 8px 16px rgba(0,0,0,0.1); text-align: center; max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative; z-index: 1; }
h1 { color: #333; font-size: 24px; margin-top: 0; }

.setup-section { margin: 20px 0; text-align: left; background: #f9f9f9; padding: 15px; border-radius: 5px; border: 1px solid #eee; }
.setup-label { font-size: 16px; font-weight: bold; cursor: pointer; display: flex; align-items: center; margin-bottom: 10px; color: #444; }
.setup-label input { margin-right: 10px; width: 18px; height: 18px; }
.timer-input-group { padding-left: 28px; margin-bottom: 15px; }
.timer-input-group input[type="number"] { width: 60px; padding: 5px; font-size: 16px; margin-left: 10px; border: 1px solid #ccc; border-radius: 4px;}

.category-select { width: 100%; padding: 10px; font-size: 16px; border-radius: 5px; border: 1px solid #ccc; margin-top: 5px; cursor: pointer; }

#quiz-screen { display: none; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px solid #f4f4f9; padding-bottom: 15px; }
.progress-tracker { font-size: 16px; font-weight: bold; color: #555; }
.timer { font-size: 22px; font-weight: bold; color: #d9534f; background: #ffebeb; padding: 10px 15px; border-radius: 5px; margin: 0; border: 1px solid #f5c6c6; }

.control-panel { display: flex; gap: 10px; }
.btn-small { padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: bold; transition: 0.2s; }
.btn-pause { background-color: #f0ad4e; color: white; }
.btn-pause:hover { background-color: #ec971f; }
.btn-stop { background-color: #d9534f; color: white; }
.btn-stop:hover { background-color: #c9302c; }

.question { font-size: 20px; margin: 20px 0; text-align: left; }
.category-label { font-size: 14px; color: #777; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; display: block; margin-bottom: 5px;}
.word { font-weight: normal; font-size: 20px; color: #333; display: block; margin-top: 10px; line-height: 1.4; }

.btn { display: block; width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; background-color: #f8f9fa; border-radius: 5px; cursor: pointer; font-size: 16px; transition: 0.2s; text-align: left; color: #333; }
.btn:hover:not(:disabled) { background-color: #e2e6ea; border-color: #dae0e5; }
.btn.correct { background-color: #4CAF50; color: white; border-color: #4CAF50; }
.btn.wrong { background-color: #f44336; color: white; border-color: #f44336; }
.btn.start-btn { background-color: #0056b3; color: white; font-weight: bold; font-size: 18px; margin-top: 20px; text-align: center; border: none; }
.btn.start-btn:hover { background-color: #004494; }
.btn:disabled { cursor: default; opacity: 0.9; }

#explanation-box { display: none; margin-top: 20px; padding: 15px; background-color: #e9ecef; border-left: 4px solid #0056b3; text-align: left; font-size: 15px; border-radius: 4px; line-height: 1.5; }
.time-out-text { color: #d9534f; font-weight: bold; margin-bottom: 5px; display: block; }
#next-btn { background-color: #4CAF50; color: white; display: none; margin-top: 20px; font-weight: bold; text-align: center; border: none; }
#next-btn:hover { background-color: #45a049; }
.score { font-size: 18px; margin-top: 20px; font-weight: bold; color: #555; display: none; }

.review-section { text-align: left; margin-top: 20px; border-top: 2px solid #ddd; padding-top: 20px; }
.review-item { margin-bottom: 15px; padding: 15px; background: #fff3f3; border-left: 4px solid #d9534f; border-radius: 4px; font-size: 15px; line-height: 1.4; }
.review-item strong { color: #d9534f; }
.review-item .correct-text { color: #4CAF50; font-weight: bold; }
.review-question { font-weight: bold; margin: 8px 0; font-size: 16px; color: #333;}
.percentage { font-size: 28px; color: #0056b3; margin: 10px 0; font-weight: bold; }

#pause-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.95); border-radius: 10px; z-index: 10; flex-direction: column; justify-content: center; align-items: center; padding: 30px; box-sizing: border-box; }
.pause-title { font-size: 28px; color: #f0ad4e; margin-bottom: 20px; font-weight: bold; }
.tip-box { background: #eef6fc; border-left: 4px solid #5bc0de; padding: 20px; border-radius: 5px; font-size: 18px; color: #333; line-height: 1.5; margin-bottom: 30px; text-align: left; width: 100%; }
.tip-label { font-weight: bold; color: #0056b3; display: block; margin-bottom: 10px; font-size: 14px; text-transform: uppercase; }

.dev-footer { max-width: 600px; width: 100%; margin-top: 20px; padding: 20px; background: white; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); text-align: center; color: #555; line-height: 1.5; font-size: 14px; z-index: 1; }
.dev-footer h3 { color: #333; font-size: 18px; margin-top: 0; margin-bottom: 10px; }
.dev-footer a { color: #0056b3; text-decoration: none; font-weight: bold; }
.dev-footer a:hover { text-decoration: underline; }
.qr-slot img {
    image-rendering: -webkit-optimize-contrast; /* For Chrome/Safari */
    image-rendering: crisp-edges;               /* For Firefox */
}
.qr-slot img {
    max-width: 250px; /* Changed from 150px to 250px */
    width: 100%;      /* Ensures it scales within the max-width */
    height: auto;     /* Maintains the aspect ratio */
    border-radius: 10px;
    display: block;
    margin: 10px auto; /* Centers the image */
}
.donation-text { font-weight: bold; color: #4CAF50; margin-top: 10px; }

/* History Dashboard & Flag Styles */
.history-item { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; font-weight: bold; color: #555; }
.history-bar-bg { background: #e9ecef; width: 100%; height: 10px; border-radius: 5px; margin-bottom: 15px; overflow: hidden; }
.history-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease-in-out; }
.flagged-item { background: #fffde7; border-left: 4px solid #ffc107; }
.flagged-item strong { color: #ff9800; }

/* Navigation Grid Styles */
.grid-box-btn { width: 100%; aspect-ratio: 1; border: 1px solid #ccc; border-radius: 5px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; transition: 0.2s; background: #e9ecef; color: #333; }
.grid-box-btn:hover { opacity: 0.8; transform: scale(1.05); }
.grid-box-btn.answered { background: #0056b3; color: white; border-color: #004494; }
.grid-box-btn.flagged { background: #ffc107; color: #333; border-color: #d39e00; }
.grid-box-btn.current { border: 3px solid #28a745; transform: scale(1.1); box-shadow: 0 0 8px rgba(40,167,69,0.5); }

/* 5v5 Quick Match Styles */
.match-column { display: flex; flex-direction: column; gap: 15px; width: 42%; z-index: 2; }
.match-card { padding: 15px 10px; border: 2px solid #ccc; border-radius: 8px; background: white; cursor: pointer; text-align: center; font-weight: bold; font-size: 15px; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); user-select: none; color: #333; }
.match-card:hover { border-color: #0056b3; transform: scale(1.02); }

/* Card States */
.match-card.selected { border-color: #f0ad4e; background: #fff3cd; transform: scale(1.05); box-shadow: 0 0 10px rgba(240, 173, 78, 0.5); }
.match-card.matched { border-color: #28a745; background: #d4edda; color: #155724; cursor: default; transform: none; box-shadow: none; opacity: 0.9; }
.match-card.wrong { border-color: #d9534f; background: #f8d7da; animation: shakeError 0.4s; }

.match-line { stroke: #28a745; stroke-width: 4; stroke-linecap: round; opacity: 0.7; animation: drawLine 0.3s ease-out forwards; }

@keyframes shakeError { 
    0%, 100% { transform: translateX(0); } 
    25% { transform: translateX(-5px); } 
    75% { transform: translateX(5px); } 
}
@keyframes drawLine {
    from { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
    to { stroke-dasharray: 1000; stroke-dashoffset: 0; }
}

