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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e94560, #f5a623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Wheel ── */
.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.wheel-container {
  position: relative;
  width: 500px;
  height: 500px;
}

#wheel {
  border-radius: 50%;
  display: block;
  filter: drop-shadow(0 8px 32px rgba(233,69,96,0.35));
}

.pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.4rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
  line-height: 1;
}

.spin-btn {
  padding: 0.85rem 3.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e94560, #c0392b);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(233,69,96,0.45);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(233,69,96,0.55);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(0);
}

.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Entries panel ── */
.entries-section {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  background: #16213e;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.entries-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  color: #f5a623;
}

.add-entry {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.add-entry input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid #0f3460;
  background: #0f3460;
  color: #e0e0e0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-entry input:focus {
  border-color: #e94560;
}

.add-entry input::placeholder {
  color: #6b7c99;
}

.add-entry button {
  padding: 0.55rem 1rem;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.add-entry button:hover {
  background: #c0392b;
}

#entryList {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-right: 2px;
}

#entryList::-webkit-scrollbar {
  width: 5px;
}

#entryList::-webkit-scrollbar-track {
  background: transparent;
}

#entryList::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 4px;
}

#entryList li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #0f3460;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.15s;
}

#entryList li:hover {
  background: #1a4a8a;
}

#entryList li .color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

#entryList li .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#entryList li .remove-btn {
  background: none;
  border: none;
  color: #6b7c99;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

#entryList li .remove-btn:hover {
  color: #e94560;
}

.weight-ctrl {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.weight-btn {
  background: #1a1a2e;
  border: 1px solid #2a3a5e;
  color: #b0b8cc;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.weight-btn:hover:not(:disabled) {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.weight-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.weight-num {
  min-width: 16px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f5a623;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.secondary-btn {
  flex: 1;
  padding: 0.5rem;
  background: #0f3460;
  color: #b0b8cc;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.secondary-btn:hover {
  background: #1a4a8a;
  color: #e0e0e0;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background: #16213e;
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.result-label {
  font-size: 1.1rem;
  color: #f5a623;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.result-text {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.5rem;
  word-break: break-word;
  max-width: 400px;
}

.modal-content button {
  padding: 0.65rem 2.5rem;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-content button:hover {
  background: #c0392b;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .wheel-container {
    width: 320px;
    height: 320px;
  }

  #wheel {
    width: 320px;
    height: 320px;
  }
}
