body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f7ff 100%);
  margin: 0;
  padding: 20px;
  color: #1f2937;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.app-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.visuals {
  width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-radius: 16px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.12);
  position: relative;
}

#wheelContainer {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  width: 380px;
  height: 380px;
}

#cardContainer {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  width: 460px;
  height: 380px;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  border: 2px solid #dbeafe;
}

#card {
  width: 440px;
  height: 360px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48px;
  font-weight: bold;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.card-front {
  background: linear-gradient(155deg, #3b82f6 0%, #60a5fa 100%);
  color: #fff;
}

.card-back {
  background: linear-gradient(155deg, #10b981 0%, #34d399 100%);
  color: #fff;
  transform: rotateY(180deg);
}

.flip {
  transform: rotateY(180deg);
}

.sidebar {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12);
}

.input-title {
  font-size: 14px;
  color: #334155;
  margin-bottom: 6px;
  font-weight: 600;
}

textarea {
  width: calc(100% - 20px);
  min-height: 140px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  resize: vertical;
  font-size: 14px;
  box-sizing: border-box;
}

.loaded-names {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.loaded-names h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #334155;
}

#namesList {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.name-tag {
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.controls button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
  color: #ffffff;
  background: #4f46e5;
  transition: background 0.2s ease;
}

.controls button:hover {
  background: #4338ca;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #334155;
}

.controls input[type="radio"],
.controls input[type="checkbox"] {
  accent-color: #4f46e5;
}

#result {
  margin-top: 420px;
  font-size: 42px;
  font-weight: 700;
  color: #1d4ed8;
  text-align: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 3px solid #0284c7;
  border-radius: 16px;
  padding: 24px 32px;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.2);
  letter-spacing: 1px;
}

@media (max-width: 800px) {
  .app-grid {
    flex-direction: column;
    align-items: center;
  }

  .sidebar,
  .visuals {
    width: 100%;
    max-width: 420px;
  }
}

