﻿:root {
  --bg-dark: #190f0a;
  --bg-mid: #2f1a12;
  --bg-card: #fff9ef;
  --text-main: #2a1a11;
  --text-soft: #6f4e3d;
  --accent: #f97316;
  --accent-2: #fb923c;
  --line: #f5d8bb;
  --success: #15803d;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 15%, rgba(251, 146, 60, 0.3), transparent 36%),
    radial-gradient(circle at 85% 5%, rgba(249, 115, 22, 0.36), transparent 30%),
    linear-gradient(145deg, var(--bg-dark), var(--bg-mid));
  min-height: 100vh;
}

.container {
  width: min(1080px, 94%);
  margin: 1.6rem auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.overline {
  margin: 0;
  text-transform: uppercase;
  color: #fed7aa;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

h1,
h2,
h3,
h4 {
  font-family: "Baloo 2", sans-serif;
}

h1 {
  margin: 0.25rem 0 0;
  color: #fff7ed;
  line-height: 1.1;
  font-size: clamp(1.75rem, 4vw, 2.8rem);
}

.subtitle {
  margin: 0.4rem 0 0;
  color: #fed7aa;
  font-size: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 35px rgba(25, 15, 10, 0.32);
  padding: 1rem;
}

.metrics {
  margin-top: 1.4rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

label {
  display: block;
  font-weight: 700;
  color: #4a2b1a;
  margin-bottom: 0.5rem;
}

input,
select,
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #efb98f;
  padding: 0.72rem 0.8rem;
  font: inherit;
}

input {
  margin-top: 0.3rem;
}

input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

select {
  margin-top: 0.3rem;
  background: #fff;
}

button {
  border: none;
  cursor: pointer;
  margin-top: 0.4rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}

button:hover {
  filter: brightness(1.07);
}

.ghost-btn {
  width: auto;
  background: transparent;
  border: 1px solid #fdba74;
  color: #ffedd5;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  filter: none;
}

.helper {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.scratch-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 260;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #f3cda5;
}

.prize-layer,
#scratch-canvas {
  position: absolute;
  inset: 0;
}

.prize-layer {
  background:
    radial-gradient(circle at 15% 20%, #fde68a 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, #fb923c 0%, transparent 36%),
    linear-gradient(130deg, #fff8e6, #ffe3c2);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.prize-layer h3 {
  margin: 0.2rem 0;
  font-size: clamp(1.4rem, 3.2vw, 2.25rem);
}

.prize-layer p {
  margin: 0.2rem 0;
}

.small-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #7c2d12;
  font-weight: 700;
}

.tag {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  background: #7c2d12;
  color: #ffedd5;
  display: inline-block;
}

#scratch-canvas {
  touch-action: none;
}

.ticket-result {
  margin-top: 0.75rem;
  border: 1px dashed #efb98f;
  border-radius: 12px;
  padding: 0.7rem;
}

.ticket-result p {
  margin: 0;
  font-weight: 700;
}

.coupon-box {
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 0.45rem;
}

.coupon-box span {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.coupon-box strong {
  display: block;
  font-family: "Baloo 2", sans-serif;
  font-size: 1.4rem;
  color: #c2410c;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 0.8rem;
}

.metrics-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.8rem;
}

.metrics-grid span {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.metrics-grid strong {
  display: block;
  font-family: "Baloo 2", sans-serif;
  font-size: 1.8rem;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 6, 4, 0.75);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}

.modal-card {
  width: min(900px, 100%);
  max-height: 94vh;
  overflow: auto;
  background: #fffaf4;
  border-radius: 20px;
  padding: 1rem;
  border: 1px solid #f6c89d;
}

.system-modal-card {
  width: min(460px, 100%);
  text-align: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(251, 146, 60, 0.25), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(249, 115, 22, 0.25), transparent 40%),
    #fffaf4;
}

.system-modal-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(130deg, #f97316, #fb923c);
  color: #fff;
  font-family: "Baloo 2", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin: 0 auto 0.5rem;
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.35);
}

.system-modal-card h3 {
  margin: 0;
  font-size: 1.7rem;
  color: #7c2d12;
}

.system-modal-card p {
  margin: 0.55rem 0 0.9rem;
  color: #5b3725;
  font-size: 1rem;
  line-height: 1.4;
}

.system-modal-card button {
  max-width: 220px;
  margin: 0 auto;
}

.success-modal-card {
  background:
    radial-gradient(circle at 10% 10%, rgba(34, 197, 94, 0.18), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(21, 128, 61, 0.15), transparent 40%),
    #fffaf4;
}

.success-icon {
  background: linear-gradient(130deg, #15803d, #22c55e);
}

.delete-validate-label {
  text-align: left;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.95rem;
}

.delete-validate-label strong {
  color: #7c2d12;
}

.campaign-delete-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.3rem;
}

.campaign-delete-actions button {
  margin: 0;
  width: auto;
  min-width: 170px;
}

.campaign-delete-actions .inline-ghost {
  color: #7c2d12;
  border-color: #fdba74;
}

.campaign-delete-actions .inline-ghost:hover {
  background: #fff0dd;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-header .ghost-btn {
  color: #7c2d12;
  border-color: #fdba74;
}

.modal-header .ghost-btn:hover {
  background: #fff0dd;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
}

.inline-form input {
  margin-top: 0;
}

.inline-form button {
  width: auto;
  margin-top: 0;
}

.stack-form {
  margin-bottom: 1rem;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.list {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
}

.list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.list li p {
  margin: 0;
}

.list li small {
  color: var(--text-soft);
}

.list button {
  width: auto;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
}

.list .success-btn {
  background: #15803d;
}

.list .success-btn:hover {
  filter: brightness(1.08);
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-actions .danger,
.list .danger {
  background: var(--danger);
}

.admin-actions .danger:hover,
.list .danger:hover {
  filter: brightness(1.08);
}

.error {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .inline-form {
    flex-direction: column;
  }

  .inline-form button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .prize-grid {
    grid-template-columns: 1fr;
  }
}
