:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #00c896;
  --accent-dim: #00a67d;
  --danger: #ff6b6b;
  --warning: #ffc93c;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1a3a2e 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(520px, 92vw);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.card {
  background: linear-gradient(145deg, var(--surface) 0%, #15202b 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.35rem;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #04221a;
  width: 100%;
  margin-top: 1rem;
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  margin-top: 0.75rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-top: 1rem;
}
.alert-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
}
.alert-warn {
  background: rgba(255, 201, 60, 0.1);
  border: 1px solid rgba(255, 201, 60, 0.35);
  color: #ffe08a;
}
.alert-ok {
  background: rgba(0, 200, 150, 0.12);
  border: 1px solid rgba(0, 200, 150, 0.35);
  color: #7fffd4;
}

/* Win animation */
.celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -12px;
  opacity: 0.95;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.6;
  }
}

.prize-reveal {
  text-align: center;
  padding: 1.5rem 0;
}
.prize-reveal .emoji {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.prize-reveal .gift-line {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  animation: fadeUp 0.5s ease 0.15s both;
}

@keyframes pop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.shake {
  animation: shake 0.45s ease;
}

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

.hidden {
  display: none !important;
}

.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-nav a:hover {
  color: var(--accent);
}
.admin-nav .spacer {
  flex: 1;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
table.data th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
table.data tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-ok {
  background: rgba(0, 200, 150, 0.2);
  color: #7fffd4;
}
.badge-warn {
  background: rgba(255, 201, 60, 0.15);
  color: #ffe08a;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--accent);
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
