* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.control-group {
  display: flex;
  gap: 8px;
}

.control-group input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.control-group input:focus {
  border-color: #4a90d9;
}

.control-group button {
  padding: 10px 14px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.control-group button:hover {
  background: #357abd;
}

.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
  font-size: 0.95rem;
  background: white;
  border-radius: 8px;
  border: 2px dashed #e0e0e0;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 400px;
}

thead {
  background: #2c3e50;
  color: white;
}

thead th {
  padding: 12px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

thead th:first-child {
  text-align: left;
  min-width: 120px;
}

thead th.option-header {
  min-width: 100px;
  position: relative;
}

thead th .del-btn {
  display: inline-block;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}

thead th .del-btn:hover {
  background: rgba(255,255,255,0.4);
}

tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: #fafafa;
}

tbody td {
  padding: 10px;
  font-size: 0.9rem;
}

tbody td:first-child {
  font-weight: 500;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
}

tbody td .row-del-btn {
  width: 18px;
  height: 18px;
  line-height: 18px;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  text-align: center;
  color: #999;
  flex-shrink: 0;
}

tbody td .row-del-btn:hover {
  background: #ffcccc;
  color: #c00;
}

tbody td input[type="number"] {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  display: block;
  margin: 0 auto;
}

tbody td input[type="number"]:focus {
  border-color: #4a90d9;
}

tfoot {
  background: #eaf2fb;
}

tfoot td {
  padding: 12px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  color: #2c3e50;
}

tfoot td:first-child {
  text-align: left;
}

tfoot td.top-score {
  background: #d4edda;
  color: #1a6e2e;
}

.actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 9px 18px;
  background: white;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: #e74c3c;
  color: white;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.25rem;
  }

  .control-group button {
    font-size: 0.82rem;
    padding: 10px 10px;
  }

  tbody td input[type="number"] {
    width: 52px;
  }
}
