* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
  color: #0f172a;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  text-align: center;
  color: #111827;
}

.subtitle {
  margin: 0 0 28px;
  text-align: center;
  color: #475569;
  line-height: 1.6;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
}

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

label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
}

select,
.checkbox-row {
  font-size: 1rem;
  color: #334155;
}

select {
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.button-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(99, 102, 241, 0.35);
}

button:active {
  transform: translateY(0);
}

.result-grid {
  display: grid;
  gap: 16px;
  margin: 28px 0 20px;
}

.result-card {
  border-radius: 20px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.result-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.bonus-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748b;
  margin: 0 2px 0 6px;
}

.info {
  margin-top: 10px;
  padding: 18px;
  background: #f8fafc;
  border-radius: 16px;
  color: #334155;
  line-height: 1.7;
  font-size: 0.95rem;
}

.history {
  margin-top: 24px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history h2 {
  font-size: 1rem;
  margin: 0;
  color: #111827;
}

.clear-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}

.clear-btn:hover {
  background: #f1f5f9;
  color: #ef4444;
  transform: none;
  box-shadow: none;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.history-list li {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px 14px;
  color: #334155;
  font-weight: 600;
  line-height: 1.6;
}

.empty-text {
  color: #64748b;
  font-weight: 500;
}

@media (max-width: 600px) {
  .card {
    padding: 24px 18px;
  }

  h1 {
    font-size: 1.6rem;
  }
}
