body {
    margin: 0;
    padding: 0;
    overflow: auto;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

#game-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: calc(100vh - 60px - 300px);
    transition: all 0.3s ease;
}

#data-model, #game-settings {
    width: 300px;
    background-color: #fff;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    transition: all 0.3s ease;
}

#data-model {
    border-right: 1px solid #ccc;
}

#game-settings {
    border-left: 1px solid #ccc;
}

#data-model h2, #game-settings h2, #player-stats h2 {
    margin-top: 0;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

#data-model h3, #game-settings h3, #player-stats h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #333;
}

#data-model pre {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 5px 0;
    font-family: monospace;
    font-size: 12px;
}

#game-area {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas {
    display: block;
    width: 800px;
    height: 600px;
    border: 1px solid #ccc;
}

#game-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 0;
    z-index: 10;
}

#question {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

#score {
    text-align: center;
    font-size: 18px;
    color: #333;
    margin: 5px 0 0 0;
}

.data-item {
    margin-bottom: 10px;
}

.data-label {
    font-weight: bold;
    margin-right: 5px;
}

.data-value {
    font-family: monospace;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 5px;
    text-align: left;
    font-size: 12px;
}

th {
    background-color: #f2f2f2;
}

.current-question {
    background-color: #ffffcc;
}

.setting-group {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.setting-item {
    margin-bottom: 8px;
}

.setting-label {
    display: block;
    margin-bottom: 3px;
    font-weight: bold;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
}

.checkbox-item {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

input[type="checkbox"] {
    margin-right: 5px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #45a049;
}

.slider-container {
    width: 100%;
    margin-top: 5px;
}

.slider {
    width: 100%;
}

.slider-value {
    display: inline-block;
    margin-left: 10px;
    font-family: monospace;
}

#data-model, #game-settings {
    padding-top: 60px;
}

#player-stats {
    width: 100%;
    background-color: #fff;
    padding: 20px;
    box-sizing: border-box;
    height: 300px;
    border-top: 1px solid #ccc;
    transition: all 0.3s ease;
}

.stats-container {
    display: flex;
    flex-direction: row;
    height: 220px;
}

.stats-summary {
    width: 300px;
    padding-right: 20px;
}

.stats-graph {
    flex-grow: 1;
    position: relative;
    height: 100%;
}

.graph-container {
    height: 100%;
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    padding: 10px;
}

.graph-bar {
    display: inline-block;
    position: relative;
    margin: 0 4px;
    background: linear-gradient(to top, #4CAF50, #8BC34A);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.graph-bar.incorrect {
    background: linear-gradient(to top, #F44336, #FF9800);
}

.graph-bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
}

.graph-axis {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: #333;
}

.graph-legend {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

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

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 2px;
}

.legend-color.correct {
    background: linear-gradient(to top, #4CAF50, #8BC34A);
}

.legend-color.incorrect {
    background: linear-gradient(to top, #F44336, #FF9800);
}

.stats-summary-table {
    width: 100%;
    margin-top: 10px;
}

.stats-summary-table th,
.stats-summary-table td {
    padding: 6px;
    text-align: center;
}

.operation-stats {
    margin-top: 10px;
}

.progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 5px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 2px;
}

#toggle-button {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 20px;
    transition: transform 0.3s ease;
}

#toggle-button:hover {
    background-color: rgba(255, 255, 255, 1);
}

#toggle-button.active {
    transform: rotate(180deg);
}

#leaderboard-button {
    position: fixed;
    top: 15px;
    right: 65px;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 20px;
    transition: background-color 0.3s ease;
}

#leaderboard-button:hover {
    background-color: rgba(255, 255, 255, 1);
}

#leaderboard-button.active {
    background-color: #FFD700;
    color: white;
}

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

.panels-hidden #data-model {
    margin-left: -300px;
    opacity: 0;
}

.panels-hidden #game-settings {
    margin-right: -300px;
    opacity: 0;
}

.panels-hidden #player-stats {
    margin-bottom: -300px;
    opacity: 0;
}

.panels-hidden #game-container {
    height: calc(100vh - 60px);
}
