* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0; padding: 20px; background: #f5f5f5;
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.board-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.segment { stroke: #000; stroke-width: 0.8; }
.number {
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #000;
  user-select: none;
}

.current-double {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  background: linear-gradient(135deg, #dc3545, #c82333);
  border-radius: 12px;
  border: 1px solid #bd2130;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}

.current-double.green {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  border: 1px solid #1c7430;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.current-double-text {
  font-size: 48px;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

input[type="number"] {
  width: 120px;
  font-size: 28px;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  outline: none;
  border-color: #007acc;
  box-shadow: 0 0 0 3px rgba(0,122,204,0.1);
}

/* Remove spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

.btn {
  font-size: 18px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  margin: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  line-height: 1;
  box-sizing: border-box;
  vertical-align: middle;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
  color: white;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button.btn {}

a.btn {}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

.stats-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.stats-item:last-child { border-bottom: none; }

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 24px;
  border-radius: 4px;
  color: white;
  font-weight: 600;
  font-size: 11px;
  margin-right: 12px;
  flex-shrink: 0;
}

.badge-red { background: #dc3545; }
.badge-green { background: #28a745; }

.totals {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
}

h1 {
  text-align: center;
  margin: 0 0 30px 0;
  color: #333;
  font-size: 28px;
  font-weight: 300;
}

h3 {
  margin: 0 0 20px 0;
  text-align: center;
  color: #666;
  font-weight: 500;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.report-header .btn {
  position: absolute;
  left: 0;
}

@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .panel { padding: 15px; }
  .current-double-text { font-size: 36px; }
}

.report {
  max-width: 1400px;
  margin: 0 auto;
}
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chart-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  text-align: center;
}

.chart-wrapper {
  position: relative;
  min-height: 400px;
}

.no-data {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
  background-color: white;
}

.full-width {
  grid-column: 1 / -1;
}

.heatmap-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  overflow-x: auto;
  width: 100%;
}

.heatmap-table {
  border-spacing: 10px;
  border-collapse: separate;
}

.heatmap-table th, .heatmap-table td {
  text-align: center;
}

.heatmap-table th {
  font-weight: bold;
  color: #2c3e50;
}

.heatmap-table td {
  min-width: 40px;
  height: 40px;
}

.heatmap-cell {
  border-radius: 4px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.date-column {
  text-align: right;
  padding-right: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  margin-top: 15px;
  font-size: 12px;
}

.legend-label {
  margin: 0 8px;
}

.legend-color {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin: 0 3px;
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .heatmap-table th, .heatmap-table td {
    padding: 4px;
  }

  .heatmap-table td {
    min-width: 14px;
    height: 14px;
  }
}

.chain-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.chain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.chain-item.current {
  background-color: #e8f4fd;
  border-color: #007bff;
}

.chain-double {
  font-weight: bold;
  min-width: 50px;
}

.chain-input {
  width: 60px;
  text-align: center;
  padding: 4px;
}

.chain-input:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.chain-complete {
  color: #28a745;
  font-weight: bold;
  margin-left: 10px;
}

.sequence-info {
  margin: 15px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}
