:root {
  --bg: #0e1317;
  --panel: linear-gradient(180deg, rgba(20, 25, 30, 0.94), rgba(10, 14, 19, 0.98));
  --panel-strong: linear-gradient(180deg, rgba(28, 35, 42, 0.96), rgba(14, 19, 25, 0.98));
  --line: rgba(205, 167, 92, 0.16);
  --line-strong: rgba(205, 167, 92, 0.34);
  --text: #f3efe6;
  --muted: #b8ac9d;
  --accent: #d5ab63;
  --accent-soft: #f0d9a7;
  --accent-deep: #9f6a1e;
  --danger: #e16b56;
  --success: #7cc698;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(7, 10, 14, 0.78), rgba(5, 7, 10, 0.92)),
    radial-gradient(circle at top left, rgba(213, 171, 99, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(213, 171, 99, 0.09), transparent 24%),
    url('/shared-assets/fondo2.png') center center / cover fixed no-repeat,
    linear-gradient(180deg, #10151b 0%, #080b0e 100%);
  color: var(--text);
  font: 15px/1.55 "Manrope", "Segoe UI Variable Text", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(213, 171, 99, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213, 171, 99, 0.024) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 88%);
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.loading-shell,
.raffles-shell,
.guest-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 14px;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.raffles-shell,
.guest-shell {
  position: relative;
  padding: 22px 0 36px;
}

.backdrop {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.65;
  pointer-events: none;
}

.backdrop-a {
  width: 220px;
  height: 220px;
  top: 56px;
  right: 4%;
  background: rgba(244, 174, 72, 0.14);
}

.backdrop-b {
  width: 180px;
  height: 180px;
  bottom: 22px;
  left: 4%;
  background: rgba(225, 107, 86, 0.14);
}

.hero-card,
.dashboard-topbar,
.content-grid {
  position: relative;
  z-index: 1;
}

.hero-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(213, 171, 99, 0.14), transparent 30%),
    var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy-block {
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(240, 199, 103, 0.18), rgba(14, 14, 15, 0.96) 72%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hero h1,
.panel-head h2,
.detail-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.hero-card h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
}

.guest-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.auth-gate-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  gap: 24px;
}

.auth-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.auth-panel-actions,
.guest-steps,
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guest-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guest-step {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.guest-step strong {
  display: block;
  margin-bottom: 6px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.dashboard-title {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.dashboard-copy {
  color: var(--muted);
  margin: 0;
}

.dashboard-session {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.dashboard-session img,
.dashboard-session .avatar-fallback {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-session-copy {
  min-width: 0;
}

.dashboard-session-copy .eyebrow {
  margin-bottom: 4px;
}

.dashboard-session-copy strong {
  display: block;
  line-height: 1.1;
}

.dashboard-session-copy p {
  margin: 2px 0 0;
  color: var(--muted);
}

.dashboard-session-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hero-highlights,
.session-checklist,
.security-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-pills,
.session-role-list,
.raffle-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-btn {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #1c160d;
  font-weight: 700;
  border-color: rgba(213, 171, 99, 0.38);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.raffle-card:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.feedback.success {
  background: rgba(124, 198, 152, 0.16);
  border-color: rgba(124, 198, 152, 0.24);
}

.feedback.error {
  background: rgba(225, 107, 86, 0.18);
  border-color: rgba(225, 107, 86, 0.22);
}

.content-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.content-grid {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.logged-in-grid {
  margin-top: 16px;
}

.list-panel,
.detail-panel,
.empty-box {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.list-panel,
.detail-panel {
  padding: 20px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-head h2,
.detail-head h2,
.winner-card strong {
  display: block;
}

.detail-copy,
.raffle-card p,
.empty-box p,
.muted,
.inline-note {
  color: var(--muted);
}

.avatar-fallback {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.inline-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
}

.hero-link {
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 0;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.hero-link:hover,
.inline-link:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.panel-head {
  margin-bottom: 14px;
}

.raffle-list {
  display: grid;
  gap: 10px;
}

.raffle-card {
  width: 100%;
  padding: 16px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-strong);
  color: var(--text);
}

.raffle-card.selected {
  border-color: rgba(213, 171, 99, 0.42);
  box-shadow: inset 0 0 0 1px rgba(213, 171, 99, 0.24);
}

.raffle-card strong {
  margin-bottom: 6px;
}

.raffle-card-summary {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.raffle-card p {
  margin: 0 0 12px;
  line-height: 1.45;
}

.raffle-card-meta,
.detail-stats {
  display: grid;
  gap: 10px;
}

.raffle-card-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.pill.neutral {
  color: var(--muted);
}

.status-open {
  background: rgba(124, 198, 152, 0.16);
  border-color: rgba(124, 198, 152, 0.26);
}

.status-scheduled {
  background: rgba(213, 171, 99, 0.14);
  border-color: rgba(213, 171, 99, 0.24);
}

.status-closed,
.status-drawn {
  background: rgba(127, 164, 228, 0.14);
  border-color: rgba(127, 164, 228, 0.24);
}

.status-cancelled {
  background: rgba(225, 107, 86, 0.16);
  border-color: rgba(225, 107, 86, 0.24);
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.detail-copy {
  margin: 16px 0;
  line-height: 1.6;
}

.detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.detail-stats div {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.detail-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.security-strip {
  margin-top: 14px;
}

.winner-block h3 {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
}

.winner-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.winner-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.winner-card span,
.winner-card small {
  display: block;
  color: var(--muted);
}

.empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 360px;
}

.empty-box {
  padding: 22px;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .auth-gate-card,
  .guest-steps,
  .content-grid,
  .detail-stats,
  .winner-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .raffles-shell,
  .guest-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
  }

  .hero-card,
  .dashboard-topbar,
  .detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-session {
    width: 100%;
  }

  .topbar-actions,
  .auth-panel-actions {
    width: 100%;
  }

  .topbar-actions > *,
  .auth-panel-actions > * {
    flex: 1 1 auto;
  }

  .raffle-card-meta {
    grid-template-columns: 1fr;
  }
}