:root {
  --bg: #0b0c10;
  --panel: #14151b;
  --ink: #f3f3ef;
  --muted: rgba(243, 243, 239, 0.6);
  --accent: #f6c453;
  --accent-2: #ff6b6b;
  --glow: rgba(246, 196, 83, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(246, 196, 83, 0.2), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(255, 107, 107, 0.2), transparent 50%),
    #0b0c10;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 70px;
  display: grid;
  gap: 28px;
}

.hero {
  display: grid;
  gap: 8px;
}

.title {
  font-size: 40px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.sub {
  color: var(--muted);
}

.wheel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.35));
  border-radius: 24px;
  padding: 34px 22px 44px;
  text-align: center;
  position: relative;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.wheel::before {
  content: "";
  position: absolute;
  inset: -30% 20% 60% -10%;
  background: radial-gradient(circle, rgba(246, 196, 83, 0.22), transparent 60%);
  opacity: 0.9;
}

.pointer {
  font-size: 22px;
  color: var(--accent);
}

.slot {
  margin-top: 14px;
  font-size: 30px;
  padding: 22px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  min-height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  letter-spacing: 3px;
  position: relative;
  z-index: 1;
}

.limit {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.panel {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.draw,
.reset {
  border: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draw {
  background: linear-gradient(120deg, #ffd46a, #f6c453);
  color: #1c1506;
  box-shadow: 0 14px 30px var(--glow);
}

.reset {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.draw:active,
.reset:active {
  transform: translateY(1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.draw:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.is-hidden {
  display: none;
}

.pool {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.list-title {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.pool .items {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.3s ease;
}

.pool:hover .items,
.pool:focus-within .items {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.item {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.item.junk {
  opacity: 0.7;
}

.history .item {
  background: rgba(246, 196, 83, 0.18);
  border-color: rgba(246, 196, 83, 0.35);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.7);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: min(420px, 90vw);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.45));
  border-radius: 20px;
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  max-height: 85vh;
  overflow: auto;
}

.modal-title {
  font-size: 20px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 18px;
}

.prize-name {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.prize-prob {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.bonus-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(246, 196, 83, 0.12);
  border: 1px solid rgba(246, 196, 83, 0.35);
  font-size: 14px;
  color: var(--ink);
}

.name-form {
  display: grid;
  gap: 12px;
  margin: 16px 0 14px;
}

.name-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.name-form input::placeholder {
  color: var(--muted);
}

.name-output {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.blessing-text {
  font-size: 18px;
  line-height: 1.6;
}

.modal-card.modal-final {
  width: min(560px, 92vw);
  background: radial-gradient(circle at top, rgba(246, 196, 83, 0.2), rgba(0, 0, 0, 0.45));
  border: 1px solid rgba(246, 196, 83, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7);
}

.final-title {
  font-size: 24px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.final-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gift-item {
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(246, 196, 83, 0.1);
  animation: gift-pop 0.5s ease both;
}

.gift-name {
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.gift-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.gift-item.highlight {
  border-color: rgba(246, 196, 83, 0.65);
  box-shadow: 0 12px 26px rgba(246, 196, 83, 0.25);
}

@keyframes gift-pop {
  0% {
    transform: translateY(10px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.item:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 196, 83, 0.5);
  background: rgba(246, 196, 83, 0.12);
}

.item.zero {
  opacity: 0.5;
}

.item-name {
  font-weight: 600;
}

.item-prob {
  font-size: 12px;
  color: var(--muted);
}

.preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.preview span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.preview strong {
  font-size: 16px;
  letter-spacing: 1px;
}

.pool:hover .preview,
.pool:focus-within .preview {
  border-color: rgba(246, 196, 83, 0.4);
  background: rgba(246, 196, 83, 0.12);
}

@media (max-width: 640px) {
  .app {
    padding: 32px 18px 50px;
  }

  .slot {
    font-size: 22px;
  }

  .modal {
    padding: 14px;
  }

  .modal-card {
    padding: 20px 16px;
    width: min(480px, 92vw);
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-body {
    font-size: 16px;
  }

  .prize-name {
    font-size: 20px;
  }

  .final-title {
    font-size: 20px;
    letter-spacing: 3px;
  }

  .name-form {
    gap: 10px;
  }

  .gift-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    max-height: 50vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}
