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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f0f13;
  color: #e8e8ed;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.admin-link {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-link:hover {
  text-decoration: underline;
}

.controls {
  background: #1a1a22;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-row, .file-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0f0f13;
  color: #fff;
  font-size: 1rem;
}

button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  background: #3b82f6;
  color: white;
  transition: background 0.15s;
}

button:hover {
  background: #2563eb;
}

button.danger {
  background: #ef4444;
}

button.danger:hover {
  background: #dc2626;
}

button.primary {
  background: #22c55e;
}

button.primary:hover {
  background: #16a34a;
}

button.small-danger {
  background: #7f1d1d;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.file-label {
  display: inline-block;
  padding: 10px 18px;
  background: #374151;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.file-label:hover {
  background: #4b5563;
}

#csvFile {
  display: none;
}

.wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

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

#wheel {
  border-radius: 50%;
  box-shadow: 0 0 0 8px #222, 0 0 40px rgba(0,0,0,0.6);
}

.pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid #f97316;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.spin {
  font-size: 1.4rem;
  padding: 14px 48px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-radius: 50px;
  letter-spacing: 1px;
}

.spin:hover {
  background: linear-gradient(135deg, #ea580c, #dc2626);
}

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

.bottom-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.list-panel {
  background: #1a1a22;
  border-radius: 12px;
  padding: 16px;
}

.list-panel h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h3 {
  margin-bottom: 0;
}

#nameList, #historyList {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

#nameList li, #historyList li {
  background: #2a2a35;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#historyList li {
  background: #1e3a2f;
  color: #86efac;
}

#nameList li button {
  background: transparent;
  color: #f87171;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a22;
  padding: 32px 48px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  z-index: 101;
}

.modal-content h2 {
  margin-bottom: 12px;
  color: #f97316;
}

#winnerName {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
}

/* Confetti canvas */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* Admin */
.admin-section {
  background: #1a1a22;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section h2 {
  margin-bottom: 8px;
}

.hint {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.force-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.force-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #2a2a35;
  border-radius: 8px;
  cursor: pointer;
}

.force-item input {
  width: 18px;
  height: 18px;
}

.admin-actions {
  display: flex;
  gap: 12px;
}

#adminNameList {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#adminNameList li {
  background: #2a2a35;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .bottom-panels {
    grid-template-columns: 1fr;
  }
  .wheel-wrapper, #wheel {
    width: 320px;
    height: 320px;
  }
}
.admin-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 8px 0 4px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: inherit;
  font-size: 15px;
}
