* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #edf1f7;
  color: #222;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: #fff;
  padding: 25px 30px;
  border-radius: 16px;
  max-width: 750px;
  width: 100%;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  text-align: center;
}

h1, h2, h3 {
  margin-top: 0;
  color: #1f3b63;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d3d7dd;
  margin-bottom: 15px;
  font-size: 1rem;
}

.primary {
  background: #1f6ec7;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.secondary {
  background: #fff;
  border: 1px solid #1f6ec7;
  color: #1f6ec7;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 12px;
}

.primary:hover, .secondary:hover {
  opacity: 0.9;
}

.character-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
}

.character-btn {
  border: 2px solid transparent;
  background: #f1f5fb;
  border-radius: 12px;
  padding: 12px 15px;
  cursor: pointer;
  width: 150px;
}

.character-btn img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.character-btn.selected {
  border: 2px solid #1f6ec7;
  background: #e8f1ff;
}

.note {
  font-size: 0.85rem;
  color: #666;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  z-index: 5;
}

.builder-container {
  margin-top: 70px;
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
}

.builder-left {
  width: 200px;
  display: flex;
  justify-content: center;
}

.builder-left img {
  width: 160px;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.builder-right {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  padding: 20px 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.option-card {
  background: #f1f5fb;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: left;
  min-height: 90px;
}

.option-card strong {
  display: block;
  margin-bottom: 5px;
  color: #1f3b63;
}

.option-card.selected {
  border-color: #1f6ec7;
  background: #eaf2ff;
}

.actions-row {
  display: flex;
  gap: 14px;
  margin-top: 5px;
}

.result-card .law-preview {
  text-align: left;
  background: #fffef8;
  border: 1px solid #e4d9c2;
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 18px;
  font-family: "Merriweather", serif;
}

.law-preview h4 {
  margin-top: 0;
  color: #002B5B;
}

@media (max-width: 900px) {
  .builder-container {
    flex-direction: column;
  }
  .builder-left {
    width: 100%;
  }
  .builder-left img {
    margin: 0 auto;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
