﻿* {
  box-sizing: border-box;
}

:root {
  --bg: #eef3ff;
  --card: rgba(255, 255, 255, 0.82);
  --text: #121827;
  --muted: #65728a;
  --primary: #3f5cff;
  --primary-dark: #263cce;
  --danger: #ef3340;
  --border: rgba(120, 135, 165, 0.24);
  --shadow: 0 26px 70px rgba(34, 48, 82, 0.18);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, #ffffff 0, transparent 34%),
    linear-gradient(135deg, #eef3ff, #d9e4ff 48%, #f7ecff);
  color: var(--text);
}

.background-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

.glow-one {
  right: -120px;
  top: 80px;
  background: #7c5cff;
}

.glow-two {
  left: -120px;
  bottom: 60px;
  background: #29b6a8;
}

.app {
  width: min(1220px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 34px;
  align-items: center;
}

.panel,
.wheel-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 28px;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(63, 92, 255, 0.1);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 10px;
  font-size: 38px;
  letter-spacing: -1px;
}

.desc {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  border: 1px solid #cfd8ea;
  border-radius: 22px;
  padding: 16px;
  font-size: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(63, 92, 255, 0.13);
}

.actions,
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 26px rgba(63, 92, 255, 0.24);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(63, 92, 255, 0.28);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button {
  color: #273246;
  background: #e8edf8;
  box-shadow: none;
}

.danger-button {
  background: linear-gradient(135deg, #ff5f6d, var(--danger));
  box-shadow: 0 12px 26px rgba(239, 51, 64, 0.22);
}

.name-count {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tip {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(41, 182, 168, 0.1);
  color: #246b63;
  font-size: 14px;
  line-height: 1.45;
}

.wheel-card {
  min-height: 680px;
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
}

.wheel-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wheel-header strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.wheel-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.remaining-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(18, 24, 39, 0.08);
  color: #273246;
  font-weight: 800;
}

.wheel-wrapper {
  position: relative;
  width: min(620px, 88vw);
  height: min(620px, 88vw);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 30px 42px rgba(24, 35, 58, 0.24));
}

.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-top: 52px solid var(--danger);
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.22));
}

.center-spin {
  position: absolute;
  z-index: 5;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 0;
  border: 8px solid rgba(255, 255, 255, 0.9);
  font-size: 17px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 20, 35, 0.48);
  backdrop-filter: blur(10px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 30px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  animation: popIn 0.22s ease-out;
}

.modal-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(63, 92, 255, 0.1);
  font-size: 32px;
}

.modal-kicker {
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.modal-card h2 {
  margin: 8px 0 8px;
  font-size: 36px;
  letter-spacing: -0.8px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
}

.modal-actions {
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 950px) {
  .app {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .wheel-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 20px, 1220px);
    padding: 16px 0;
    gap: 18px;
  }

  .panel,
  .wheel-card {
    border-radius: 22px;
    padding: 18px;
  }

  h1 {
    font-size: 31px;
  }

  .wheel-header {
    align-items: flex-start;
  }

  .wheel-header strong {
    font-size: 18px;
  }

  .center-spin {
    width: 88px;
    height: 88px;
    font-size: 14px;
  }

  .pointer {
    border-left-width: 18px;
    border-right-width: 18px;
    border-top-width: 42px;
  }
}
