/* Body & Reset */
body {
  margin: 0;
  padding: 30px;
  background: linear-gradient(135deg, #0a0f1d 0%, #141c38 100%);
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  color: #e6eef7;
  line-height: 1.6;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
}
header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
header p {
  font-size: 1rem;
  color: #a0bcd6;
}

/* Grid for charts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

/* Chart Cards */
.card {
  background: #1b2846;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  display: flex;
  flex-direction: column;
  align-items: center;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* Chart wrapper ALWAYS 1:1 */
.chart-wrap {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1 / 1;  /* Always a perfect square */
  position: relative;
  margin: 0 auto 20px auto;
}

/* Canvas fills the square wrapper */
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Question text */
.question-text {
  margin-top: 15px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #cfe6ff;
}

/* Submissions list */
#submissions-list ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}
#submissions-list li {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 20px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 1rem;
  align-items: center;
}
#submissions-list li:nth-child(even) {
  background-color: rgba(255,255,255,0.03);
}
#submissions-list li:hover {
  background-color: rgba(255,255,255,0.08);
}
.sub-username {
  font-weight: 600;
  color: #cfe6ff;
  overflow-wrap: anywhere;
}
.sub-date {
  color: #a0bcd6;
  text-align: right;
  white-space: nowrap;
}
.header-row {
  font-weight: bold;
  background-color: #243b5e;
  border-bottom: 2px solid #4fb0c6;
}

/* Footer */
footer {
  margin-top: 50px;
  text-align: center;
  color: #7ea9d0;
  font-size: 0.9rem;
}

/* Tablet */
@media (max-width: 1024px