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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151c3b 0, #050816 55%, #02010a 100%);
  color: #f9fafb;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 1200px;
  padding: 32px 20px 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-title {
  margin: 0 0 8px;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
}

.app-subtitle {
  margin: 0;
  max-width: 640px;
  margin-inline: auto;
  color: #9ca3af;
  font-size: 0.95rem;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr);
  gap: 24px;
}

.control-panel {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(148, 163, 184, 0.15);
}

.draw-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.text-input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.text-input::placeholder {
  color: #6b7280;
}

.text-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6), 0 14px 40px rgba(8, 47, 73, 0.7);
  background: rgba(15, 23, 42, 0.95);
}

.primary-button {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0b1120;
  background: linear-gradient(135deg, #facc15, #f97316);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow:
    0 10px 30px rgba(245, 158, 11, 0.45),
    0 0 0 1px rgba(248, 250, 252, 0.15);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease,
    opacity 0.18s ease;
}

.primary-button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 16px 40px rgba(245, 158, 11, 0.6),
    0 0 0 1px rgba(248, 250, 252, 0.2);
  filter: brightness(1.03);
}

.primary-button:active {
  transform: translateY(0) scale(0.99);
  box-shadow:
    0 6px 20px rgba(245, 158, 11, 0.45),
    0 0 0 1px rgba(248, 250, 252, 0.18);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hint-text {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.draw-area {
  margin-top: 4px;
  background: radial-gradient(circle at top, #1e293b 0, #020617 70%);
  border-radius: 22px;
  padding: 20px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.25);
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.prize {
  position: relative;
  background: radial-gradient(circle at 20% 0, rgba(248, 250, 252, 0.16), rgba(15, 23, 42, 0.95));
  border-radius: 18px;
  padding: 10px 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.7) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 150px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.prize-inner-glow {
  position: absolute;
  inset: -40%;
  opacity: 0;
  background: radial-gradient(circle at 20% 0, rgba(251, 191, 36, 0.4), transparent 55%);
  mix-blend-mode: screen;
  filter: blur(18px);
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.prize-image-wrap {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, rgba(248, 250, 252, 0.24), rgba(15, 23, 42, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.6);
}

.prize-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.prize-label {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
}

.prize-tag {
  margin-top: 4px;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.9);
  color: #9ca3af;
  border: 1px solid rgba(75, 85, 99, 0.9);
}

.prize--no-prize .prize-image-wrap {
  background: radial-gradient(circle at 30% 0, rgba(248, 113, 113, 0.18), rgba(15, 23, 42, 0.98));
  border-color: rgba(239, 68, 68, 0.5);
}

.prize--no-prize .prize-tag {
  background: rgba(127, 29, 29, 0.9);
  color: #fecaca;
  border-color: rgba(254, 202, 202, 0.4);
}

.prize::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 3px solid transparent;
  background:
    conic-gradient(
      from 180deg,
      rgba(248, 250, 252, 0.2),
      rgba(251, 191, 36, 0.7),
      rgba(56, 189, 248, 0.7),
      rgba(251, 191, 36, 0.7),
      rgba(248, 250, 252, 0.2)
    );
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    filter 0.18s ease;
  filter: blur(0);
  z-index: -1;
}

.prize.is-active {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(251, 191, 36, 0.95);
  box-shadow:
    0 20px 40px rgba(250, 204, 21, 0.5),
    0 0 0 1px rgba(251, 191, 36, 0.9);
  background: radial-gradient(circle at 20% 0, rgba(251, 191, 36, 0.25), rgba(15, 23, 42, 0.98));
}

.prize.is-active::before {
  opacity: 1;
  transform: scale(1);
  filter: blur(1px);
}

.prize.is-active .prize-inner-glow {
  opacity: 0.6;
}

.prize.is-active .prize-image-wrap {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow:
    0 18px 40px rgba(250, 204, 21, 0.65),
    0 0 0 1px rgba(250, 250, 249, 0.98);
}

.result-area {
  margin-top: 4px;
}

.result-message {
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.9) inset;
}

.result-message strong {
  font-weight: 600;
  color: #fbbf24;
}

.result-message--win {
  border-color: rgba(34, 197, 94, 0.85);
  background: radial-gradient(circle at 10% 0, rgba(22, 163, 74, 0.32), rgba(15, 23, 42, 0.98));
  color: #bbf7d0;
}

.result-message--win strong {
  color: #bbf7d0;
}

.result-message--loss {
  border-color: rgba(239, 68, 68, 0.85);
  background: radial-gradient(circle at 10% 0, rgba(239, 68, 68, 0.32), rgba(15, 23, 42, 0.98));
  color: #fecaca;
}

.result-message--loss strong {
  color: #fecaca;
}

@media (max-width: 720px) {
  .app {
    padding-inline: 14px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .prize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

