:root {
  --bg: #fff7ed;
  --panel: #ffffff;
  --text: #18181b;
  --muted: #6b7280;
  --line: #eadfd2;
  --line-strong: #d4bda6;
  --primary: #ec4899;
  --primary-dark: #be185d;
  --secondary: #0f766e;
  --ink: #111827;
  --accent: #f97316;
  --soft: #fffaf4;
  --success: #dcfce7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgb(236 72 153 / 12%), transparent 32%),
    linear-gradient(225deg, rgb(15 118 110 / 13%), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 64%);
  border-radius: 10px;
  background:
    linear-gradient(120deg, #18181b 0%, #442047 48%, #0f766e 100%);
  padding: 24px;
  color: white;
  box-shadow: 0 18px 45px rgb(24 24 27 / 20%);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: white;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgb(0 0 0 / 22%);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: 0;
  line-height: 1;
}

.brand p {
  max-width: 620px;
  margin-top: 8px;
  color: rgb(255 255 255 / 78%);
  font-size: 16px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.live-pill {
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  padding: 8px 12px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 24px;
  padding-top: 26px;
}

.panel,
.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgb(24 24 27 / 9%);
}

.panel {
  padding: 24px;
}

.panel-title,
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-title {
  justify-content: flex-start;
}

.panel-title span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 800;
}

h2 {
  font-size: 19px;
}

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

label {
  display: block;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: white;
}

input {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 320px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(236 72 153 / 18%);
}

.import-box {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #f4c7a1;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ed, #fdf2f8);
  padding: 16px;
}

.import-box h3 {
  margin: 0;
  font-size: 18px;
}

.import-box p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.import-status {
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
  color: #6b4b23;
  font-size: 13px;
  font-weight: 700;
}

.file-button {
  display: inline-flex;
  width: max-content;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  padding: 0 12px;
  cursor: pointer;
  color: #26312b;
  font-size: 14px;
  font-weight: 800;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.participants-field {
  margin-top: 16px;
}

.run-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  margin-top: 16px;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 14px 26px rgb(236 72 153 / 24%);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-dark {
  background: var(--ink);
  color: white;
}

.button-dark:hover {
  background: #374151;
}

.button-muted {
  border-color: var(--line-strong);
  background: white;
  color: #26312b;
}

.button-muted:hover {
  background: #ece6da;
}

.message {
  display: none;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  padding: 10px 12px;
  color: #344139;
  font-size: 14px;
  font-weight: 700;
}

.message.is-visible {
  display: block;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.stat {
  padding: 16px;
}

.stat span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.stat-wide {
  grid-column: 1 / -1;
}

.stat-wide strong {
  font-size: 24px;
}

.badge {
  border-radius: 999px;
  background: var(--success);
  color: var(--primary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.empty-result {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--soft);
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.result-content {
  display: grid;
  gap: 16px;
}

.prize-summary {
  border-radius: 10px;
  background: linear-gradient(135deg, #fdf2f8, #ecfeff);
  padding: 16px;
}

.prize-summary span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.prize-summary strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.winners-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.winners-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.winner-position {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

@media (max-width: 620px) {
  .app-shell {
    padding: 14px;
  }

  .hero,
  .fields-grid,
  .run-row,
  .stats,
  .actions,
  .link-row {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    align-items: stretch;
  }

  .hero-actions {
    align-items: stretch;
  }

  .panel {
    padding: 16px;
  }
}


.history-panel{margin-top:20px}
.history-list{display:flex;flex-direction:column;gap:12px}
.history-item{padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:rgba(255,255,255,.03)}
.history-item strong{display:block}
.history-item span,.history-item small{display:block;opacity:.7;margin-top:4px}
.history-empty{opacity:.6}
