/* ══════════════════════════════════════════
   ProofWheel — Neubrutalism Theme
   ══════════════════════════════════════════ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f4f5;
  color: #18181b;
  min-height: 100vh;
}

a { color: #4363d8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 3px solid #18181b;
}

.navbar .logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: #18181b;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.navbar .nav-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.navbar .nav-links a {
  color: #18181b;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 2px solid #18181b;
  border-radius: 6px;
  transition: all 0.15s;
}

.navbar .nav-links a:hover {
  background: #18181b;
  color: #fff;
  text-decoration: none;
}

.navbar .nav-links button {
  font-family: inherit;
  color: #18181b;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 2px solid #18181b;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.navbar .nav-links button:hover {
  background: #18181b;
  color: #fff;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.app {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
  align-items: flex-start;
}

.wheel-section {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.panel {
  flex: 1 1 35%;
  min-width: 260px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  border: 3px solid #18181b;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 4px 4px 0px #18181b;
}

/* ── Wheel container ── */
.wheel-container {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  background: #fff;
  border: 3px solid #18181b;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 6px 6px 0px #18181b;
}

.wheel-container canvas { width: 100%; height: 100%; }

/* ── Buttons ── */
.spin-btn {
  background: #ffe507;
  color: #18181b;
  border: 3px solid #18181b;
  padding: 0.85rem 2.8rem;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 4px 4px 0px #18181b;
}

.spin-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #18181b;
}

.spin-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #18181b;
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 4px 4px 0px #18181b;
}

.btn {
  background: #fff;
  color: #18181b;
  border: 2px solid #18181b;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-transform: uppercase;
}

.btn:hover {
  background: #18181b;
  color: #fff;
  text-decoration: none;
}

.btn-primary {
  background: #ffe507;
  border-color: #18181b;
  color: #18181b;
  font-weight: 700;
  box-shadow: 3px 3px 0px #18181b;
}

.btn-primary:hover {
  background: #e6cf00;
  color: #18181b;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px #18181b;
}

.btn-danger {
  border-color: #dc2626;
  color: #dc2626;
}

.btn-danger:hover { background: #dc2626; color: #fff; }

/* ── Form elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: #fff;
  color: #18181b;
  border: 2px solid #18181b;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-input:focus { outline: none; border-color: #4363d8; box-shadow: 3px 3px 0px #4363d8; }

textarea.form-input {
  min-height: 160px;
  resize: vertical;
}

/* ── Panel ── */
.panel h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #18181b;
  text-transform: uppercase;
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entry-count {
  font-size: 0.85rem;
  color: #71717a;
  font-weight: 600;
}

/* ── Entry list ── */
.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.entry-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f4f5;
  border: 2px solid #e4e4e7;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.entry-list li .index {
  color: #4363d8;
  font-weight: 800;
  margin-right: 0.5rem;
  min-width: 1.5em;
}

.entry-list li .remove-entry {
  background: none;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
}

.entry-list li .remove-entry:hover { color: #dc2626; }

/* ── Winner modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.visible { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff;
  border: 3px solid #18181b;
  border-radius: 16px;
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  transform: scale(0.85);
  transition: transform 0.3s;
  box-shadow: 8px 8px 0px #18181b;
}

.modal-overlay.visible .modal { transform: scale(1); }

.modal h2 { font-size: 1rem; color: #71717a; margin-bottom: 0.5rem; text-transform: uppercase; font-weight: 700; }

.modal .winner-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: #4363d8;
  margin-bottom: 1rem;
  word-break: break-word;
}

.modal .spin-hash {
  font-size: 0.7rem;
  color: #a1a1aa;
  word-break: break-all;
  margin-bottom: 1.5rem;
  font-family: monospace;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  padding: 0.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-actions .btn { padding: 0.6rem 1.4rem; }

/* ── Confetti ── */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 101;
  pointer-events: none;
  border-radius: 2px;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Auth pages ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f4f5;
}

.auth-card {
  background: #fff;
  border: 3px solid #18181b;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 6px 6px 0px #18181b;
}

.auth-card h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #18181b;
  margin-bottom: 1.5rem;
  text-align: center;
  text-transform: uppercase;
}

.auth-card .error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: none;
  background: #fef2f2;
  border: 2px solid #dc2626;
  border-radius: 6px;
  padding: 0.5rem;
}

.auth-card .switch-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #71717a;
}

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.wheel-card {
  background: #fff;
  border: 3px solid #18181b;
  border-radius: 12px;
  padding: 1.2rem;
  transition: all 0.15s;
  box-shadow: 4px 4px 0px #18181b;
}

.wheel-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #18181b;
}

.wheel-card h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.wheel-card .meta {
  font-size: 0.8rem;
  color: #71717a;
  margin-bottom: 0.75rem;
}

.wheel-card .badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  border: 2px solid #18181b;
  text-transform: uppercase;
}

.badge-public { background: #dcfce7; color: #16a34a; }
.badge-private { background: #fff7ed; color: #ea580c; }

/* ── Spin log ── */
.spin-log {
  margin-top: 1.5rem;
}

.spin-log h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #18181b;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.spin-log table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.spin-log th, .spin-log td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 2px solid #e4e4e7;
}

.spin-log th { color: #71717a; font-weight: 700; text-transform: uppercase; font-size: 0.7rem; }

.spin-log .hash { font-family: monospace; font-size: 0.7rem; color: #a1a1aa; transition: color 0.15s; }
.spin-log .hash:hover { color: #4363d8; }

.spin-log .verify-btn {
  background: #fff;
  border: 2px solid #18181b;
  color: #18181b;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}

.spin-log .verify-btn:hover { background: #18181b; color: #fff; }
.spin-log .verified { color: #16a34a; font-weight: 700; }
.spin-log .failed { color: #dc2626; font-weight: 700; }

/* ── Profile page ── */
.profile-header {
  margin-bottom: 2rem;
}

.profile-header h1 {
  font-size: 2rem;
  font-weight: 900;
  color: #18181b;
}

.profile-header .joined {
  font-size: 0.85rem;
  color: #71717a;
  font-weight: 600;
}

/* ── Admin dashboard ── */
.admin-wheels {
  margin-top: 1rem;
}

.admin-wheel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 2px solid #18181b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 3px 3px 0px #18181b;
}

.admin-wheel-row .info {
  flex: 1;
}

.admin-wheel-row .info h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; }
.admin-wheel-row .info .meta { font-size: 0.8rem; color: #71717a; }

.admin-wheel-row .actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-wheel-row select {
  background: #fff;
  color: #18181b;
  border: 2px solid #18181b;
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-queue-indicator {
  display: inline-block;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 20px;
  margin-left: 0.5rem;
  font-weight: 700;
  border: 2px solid #dc2626;
}

/* ── Overlay mode ── */
body.overlay-mode {
  background: transparent;
}

body.overlay-mode .wheel-container {
  max-width: 100vmin;
  margin: 0 auto;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .app {
    flex-direction: column;
    align-items: center;
  }
  .panel {
    max-width: 100%;
    width: 100%;
  }
}
