/* Reset dan Base Styles */
* {
  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;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Header */
.header {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  color: white;
  padding: 25px;
  text-align: center;
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Main Content */
.main-content {
  display: flex;
  gap: 25px;
  padding: 25px;
  min-height: 700px;
}

/* Game Panel */
.game-panel {
  flex: 1;
  background: #f8fafc;
  border-radius: 15px;
  padding: 20px;
  border: 2px solid #e2e8f0;
}

.game-header {
  margin-bottom: 20px;
}

.game-header h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4f46e5;
}

/* Game Stats di atas canvas - TAMBAHAN STYLE KHUSUS */
.game-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.game-stats .stat {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.game-stats .stat:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.game-stats .label {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-stats .value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-canvas-container {
  text-align: center;
}

#gameCanvas {
  background: linear-gradient(to bottom, #87ceeb, #98fb98);
  border: 4px solid #4f46e5;
  border-radius: 10px;
  margin-bottom: 15px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.btn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

/* Data Panel */
.data-panel {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.history-section,
.chart-section {
  background: #f8fafc;
  border-radius: 15px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  flex: 1;
}

.history-section h3,
.chart-section h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4f46e5;
}

.table-container {
  max-height: 300px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

#history-table th {
  background: #4f46e5;
  color: white;
  padding: 15px;
  position: sticky;
  top: 0;
  font-weight: 600;
}

#history-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

#history-table tr:nth-child(even) {
  background: #f1f5f9;
}

#history-table tr:hover {
  background: #e0e7ff;
}

.new-record {
  color: #10b981;
  font-weight: bold;
}

.chart-container {
  height: 250px;
  margin-top: 15px;
}

/* Footer */
.footer {
  background: #f1f5f9;
  padding: 20px;
  text-align: center;
  border-top: 2px solid #e2e8f0;
}

.footer p {
  margin-bottom: 10px;
  color: #475569;
  line-height: 1.5;
}

.group-info {
  font-weight: bold;
  color: #4f46e5;
  font-size: 1.1rem;
  margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
  }

  .game-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .game-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .game-stats .value {
    font-size: 1.5rem;
  }

  .game-controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  #gameCanvas {
    width: 100%;
    height: auto;
    max-height: 500px;
  }
}
