* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #f8fafc;
}

.app {
  width: min(90vw, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0;
  font-size: 28px;
  text-align: center;
}

.subtitle {
  margin: -10px 0 0;
  color: #cbd5e1;
}

.panel {
  width: 100%;
  background: #0b1220;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #cbd5e1;
}

.form-grid input {
  border-radius: 8px;
  border: 1px solid #475569;
  background: #111827;
  color: #f8fafc;
  padding: 10px;
}

.wheel-wrap {
  position: relative;
  padding-top: 16px;
  display: grid;
  place-items: center;
}

.pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #f8fafc;
  z-index: 2;
}

.wheel-container {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 6px solid #f8fafc;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-box {
  width: 100%;
  min-height: 64px;
  padding: 16px;
  border-radius: 12px;
  background: #0b1220;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  margin-top: 16px;
}

.spin-button {
  width: 100%;
  padding: 14px 20px;
  font-size: 22px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #22c55e;
  color: #062312;
  font-weight: 700;
  text-transform: lowercase;
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-top: 16px;
}

.spin-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.spin-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.action-button,
.ghost-button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

.action-button {
  background: #3b82f6;
  color: #f8fafc;
  font-weight: 700;
}

.action-button.secondary {
  background: #a855f7;
}

.ghost-button {
  border: 1px solid #475569;
  background: transparent;
  color: #cbd5e1;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.history-list li {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  background: #111827;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-content {
  width: min(95vw, 460px);
  background: #0b1220;
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 20px;
}

.modal-content h2 {
  margin: 0 0 12px;
}

.modal-content p {
  margin: 8px 0;
}

.modal-actions {
  margin-top: 12px;
}

.hidden {
  display: none;
}
