/* Sorteos Lucky — project-specific styles (loaded after common/styles/base.css) */

:root {
  --brand: #ea580c;
  --brand-dark: #9a3412;
  --brand-soft: #ffedd5;
  --accent: #fbbf24;
}

.hero {
  padding: 0.75rem 0 1.5rem;
}

/* ---------------- tool layout ---------------- */

.tool {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.tool .form-error {
  color: var(--bad);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
}

.tool .form-error[hidden] {
  display: none;
}

.wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.wheel-frame {
  position: relative;
  width: min(100%, 340px);
}

@media (min-width: 860px) {
  .tool {
    display: grid;
    grid-template-columns: minmax(320px, 400px) 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .wheel-area {
    position: sticky;
    top: 1rem;
  }

  .wheel-frame {
    width: 100%;
  }
}

.wheel-frame canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(154, 52, 18, 0.18);
  cursor: pointer;
  touch-action: manipulation;
}

.wheel-frame canvas[data-count="0"] {
  cursor: default;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--brand-dark);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  z-index: 1;
}

.wheel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  width: 100%;
}

/* ---------------- winner ---------------- */

.winner {
  min-height: 1.4em;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-dark);
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.winner.winner-flash {
  animation: winner-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes winner-pop {
  0% {
    transform: scale(0.6) rotate(-3deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.12) rotate(1deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* ---------------- options editor ---------------- */

.options-area h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.options-area .field {
  margin-bottom: 0.5rem;
}

.options-area .hint {
  color: var(--ink-faint);
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand);
  margin: 0;
}

.options-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
}

.participants-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.active-options,
.eliminated-panel {
  min-width: 0;
}

.active-options h3,
.eliminated-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}

.eliminated-panel {
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.eliminated-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reset-eliminated-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.eliminated-empty {
  margin: 0.7rem 0 0;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.eliminated-table {
  width: 100%;
  margin-top: 0.55rem;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: fixed;
}

.eliminated-table[hidden] {
  display: none;
}

.eliminated-table th,
.eliminated-table td {
  padding: 0.4rem 0.25rem;
  border-top: 1px solid var(--line);
  text-align: left;
}

.eliminated-table th:first-child,
.eliminated-position {
  width: 2rem;
  color: var(--ink-faint);
}

.eliminated-name {
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .participants-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.92rem;
  min-width: 0;
}

.option-swatch {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.option-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-remove {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.option-remove:hover {
  color: var(--bad);
  background: var(--bad-soft);
}

/* ---------------- content pages ---------------- */

.article a {
  color: var(--brand);
}

.article a:hover {
  color: var(--brand-dark);
}

.article .mono {
  font-size: 0.9em;
}
