/* —— Tombolă premium — Axy Market —— */
:root {
  --bg-deep: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-elevated: rgba(30, 41, 59, 0.85);
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
  --gold-dim: #d97706;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --violet: #8b5cf6;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --shadow-glow: 0 0 80px rgba(139, 92, 246, 0.15);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page__ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(139, 92, 246, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 20%, rgba(59, 130, 246, 0.12), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(251, 191, 36, 0.06), transparent 50%),
    linear-gradient(180deg, #111827 0%, #0f172a 45%, #0c1222 100%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  animation: fadeIn 0.6s var(--ease) both;
}

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

/* —— Hero —— */
.hero {
  position: relative;
  text-align: center;
  padding: 2.5rem 1.5rem 2.25rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.65) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: hidden;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

.hero__orb--1 {
  width: 200px;
  height: 200px;
  background: var(--violet);
  top: -80px;
  left: 10%;
}

.hero__orb--2 {
  width: 180px;
  height: 180px;
  background: rgba(251, 191, 36, 0.4);
  bottom: -60px;
  right: 5%;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__brand {
  margin-bottom: 1rem;
  animation: floatBrand 4s ease-in-out infinite;
}

@keyframes floatBrand {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.hero__logo {
  display: block;
  margin: 0 auto;
  max-width: min(220px, 72vw);
  height: auto;
  max-height: 88px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 28px rgba(251, 191, 36, 0.15));
  border-radius: 12px;
}

.hero__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(251, 191, 36, 0.2);
}

.hero__subtitle {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.12);
}

.hero__pill strong {
  color: var(--gold);
  font-weight: 700;
}

.hero__pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.15);
  }
}

/* —— Grid principal —— */
.main-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 899px) {
  .main-grid .card--draw {
    order: -1;
  }
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.2fr);
    align-items: stretch;
  }
}

/* —— Card —— */
.card {
  position: relative;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover {
  border-color: rgba(148, 163, 184, 0.18);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.card__head--center {
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 0.5rem;
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.card__icon--gold {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

.card__icon--green {
  background: var(--green-soft);
  color: var(--green);
}

.card__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card--draw {
  display: flex;
  flex-direction: column;
}

.card--draw .lottery {
  flex: 1;
}

/* —— Config fields —— */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field__ico {
  display: flex;
  color: var(--gold);
  opacity: 0.85;
}

.field__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.field__input:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.field__input:focus {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
  background: rgba(15, 23, 42, 0.85);
}

.pool-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), rgba(251, 191, 36, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.08);
}

.pool-pill__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pool-pill__value {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.meta-line {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alert {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  min-height: 0;
}

.alert:empty {
  display: none;
}

.alert--err {
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

/* —— Lottery / Extragere —— */
.lottery {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-bottom: 1.25rem;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, 0.08) 0%, transparent 55%),
    rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lottery__label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lottery__display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
}

.lottery__glow {
  position: absolute;
  width: min(100%, 280px);
  height: 80px;
  background: radial-gradient(ellipse, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.lottery__number {
  position: relative;
  z-index: 1;
  font-size: clamp(2.75rem, 8vw, 3.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 20px rgba(251, 191, 36, 0.5),
    0 0 48px rgba(251, 191, 36, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.06s linear, opacity 0.06s linear;
}

.lottery.is-drawing .lottery__number {
  color: var(--gold);
  animation: neonPulse 0.15s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  from {
    opacity: 0.88;
    filter: brightness(1);
  }
  to {
    opacity: 1;
    filter: brightness(1.15);
  }
}

.lottery.is-spinning .lottery__number {
  animation: rollJitter 0.1s ease-in-out infinite;
}

@keyframes rollJitter {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-1px);
  }
  75% {
    transform: translateX(1px);
  }
}

.lottery.lottery--shake {
  animation: shakeCard 0.52s var(--ease);
}

@keyframes shakeCard {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-8px) rotate(-0.5deg);
  }
  30% {
    transform: translateX(8px) rotate(0.5deg);
  }
  45% {
    transform: translateX(-6px);
  }
  60% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-3px);
  }
}

.lottery__hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 260px;
}

/* —— Buton extragere —— */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-lottery {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1c1917;
  border-radius: 16px;
  background: linear-gradient(135deg, #fde68a 0%, var(--gold) 40%, var(--gold-dim) 100%);
  box-shadow:
    0 4px 20px rgba(251, 191, 36, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  overflow: hidden;
}

.btn-lottery:not(:disabled):hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 8px 32px rgba(251, 191, 36, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.btn-lottery:not(:disabled):active {
  transform: translateY(0) scale(0.99);
}

.btn-lottery__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}

.btn-lottery:not(:disabled):hover .btn-lottery__shine {
  transform: translateX(100%);
}

.btn-lottery__label {
  position: relative;
  z-index: 1;
}

.btn-lottery.is-loading {
  pointer-events: none;
}

.btn-lottery.is-loading .btn-lottery__label::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5rem;
  border: 2px solid rgba(28, 25, 23, 0.25);
  border-top-color: #1c1917;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: spinLoad 0.65s linear infinite;
}

@keyframes spinLoad {
  to {
    transform: rotate(360deg);
  }
}

.btn-success {
  background: linear-gradient(135deg, #4ade80, var(--green));
  color: #052e16;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.25);
}

.btn-success:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.btn-outline:not(:disabled):hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.06);
}

/* —— Detalii bon —— */
.card--bon {
  margin-bottom: 1.5rem;
}

.card--bon.bon-enter {
  animation: bonPanelEnter 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bonPanelEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bon-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bon-meta .meta-item {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}

.bon-meta .meta-item:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.2);
}

.bon-meta .meta-item span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.bon-meta .meta-item strong {
  font-weight: 700;
  color: var(--text);
}

.bon-validare {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid var(--border);
}

.bon-validare.ok {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.bon-validare.err {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

/* —— Line list (înlocuiește tabelul) —— */
.line-list {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
}

.line-list__head {
  display: none;
}

@media (min-width: 640px) {
  .line-list__head {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.5fr 0.75fr;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid var(--border);
  }
}

.line-list__body {
  display: flex;
  flex-direction: column;
}

.line-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

@media (min-width: 640px) {
  .line-row {
    grid-template-columns: 1.4fr 1fr 0.5fr 0.75fr;
    align-items: center;
    gap: 0.75rem;
  }
}

.line-row:last-child {
  border-bottom: none;
}

.line-row:hover {
  background: rgba(148, 163, 184, 0.05);
}

.line-list--bon-valid .line-row:not(.line-row--tigari) {
  border-left: 2px solid rgba(34, 197, 94, 0.35);
}

.line-row--tigari {
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid var(--red);
}

.line-row--tigari .line-row__name,
.line-row--tigari .line-row__price {
  color: #fecaca;
  font-weight: 600;
}

.line-mob-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .line-mob-label {
    display: none;
  }
}

.line-row__name {
  font-weight: 600;
  color: var(--text);
}

.line-row__cat {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.line-row__qty {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.line-row__price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gold);
}

.line-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.line-raw {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.line-raw summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.line-raw pre {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  max-height: 200px;
  overflow: auto;
  font-size: 0.72rem;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  color: var(--text-muted);
}

.tag-tigari {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.actions-row .btn {
  flex: 1;
  min-width: 140px;
}

/* —— Câștigători —— */
.winner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.winner-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.22);
  font-size: 0.9rem;
  animation: fadeIn 0.4s var(--ease) both;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}

.winner-list__item:hover {
  transform: scale(1.01);
  border-color: rgba(34, 197, 94, 0.4);
}

.winner-list__nr {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #14532d;
  background: linear-gradient(135deg, #fde68a, var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}

.winner-list__body {
  flex: 1;
  min-width: 0;
}

.winner-list__item strong {
  color: var(--green);
}

.hidden {
  display: none !important;
}
