:root {
  --ink: #2b1a2e;
  --muted: #6d5c6f;
  --line: #e6dcdf;
  --paper: #fffdfb;
  --bg: #f6ece6;
  --accent: #8c2f5b;
  --accent-ink: #ffffff;
  --green: #1f6b4a;
  --red: #a32a2a;
  --gold: #fbeccb;
  --gold-ink: #6e4a00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, .poster-title { font-family: Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.15; }
h1 { margin: 0 0 16px; font-size: 1.9rem; text-wrap: balance; }
h2 { margin: 0 0 8px; font-size: 1.25rem; }

.public, .admin:has(#login:not([hidden])) {
  display: grid;
  place-items: center;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 32px 24px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(43 26 46 / 10%);
}

.public {
  --ink: #f5efe3;
  --muted: #b9b1a4;
  --paper: #141724;
  --bg: #0a0c13;
  --accent: #dcae68;
  --accent-ink: #1c1407;
  --red: #ff9f92;
}
.public .card { max-width: 480px; box-shadow: 0 10px 40px rgb(0 0 0 / 50%); }
.public input { border-color: #6f6858; background: var(--bg); }
.hero {
  display: block;
  width: calc(100% + 48px);
  height: auto;
  margin: -32px -24px 24px;
  border-radius: 16px 16px 0 0;
}

.lead { margin: 0 0 16px; }
.fine { margin: 12px 0; color: var(--muted); font-size: .9rem; }
.error { margin: 12px 0 0; color: var(--red); font-size: .95rem; }

label { display: block; margin-bottom: 6px; font-weight: 600; }

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9aab4;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font: inherit;
}

button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
:is(button, input):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.primary { background: var(--accent); color: var(--accent-ink); }
form .primary { width: 100%; margin-top: 16px; min-height: 50px; }
.quiet { background: transparent; border-color: #b9aab4; color: var(--ink); }
.approve { background: var(--green); color: #fff; }
.reject { background: transparent; border-color: var(--red); color: var(--red); }

.ticket {
  display: grid;
  justify-items: center;
  margin: 16px 0;
  padding: 16px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  color: var(--muted);
}
.ticket strong { color: var(--accent); font: 600 3.5rem/1.1 Georgia, serif; }

.panel { max-width: 760px; margin: 0 auto; padding: 16px; }
.panel section { margin-top: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar h1 { margin: 0; font-size: 1.5rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats div { display: grid; padding: 12px; background: var(--paper); border-radius: 12px; }
.stats strong { font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .85rem; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tabs button { padding: 8px 4px; background: transparent; border-color: #b9aab4; color: var(--ink); font-size: .9rem; }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.entries { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.entries li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--paper);
  border-radius: 12px;
}
.entry-info { display: grid; justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.entry-info > span:not(.tag) { color: var(--muted); font-size: .9rem; }
.entry-actions { display: flex; gap: 8px; }
.tag {
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: .8rem;
  font-weight: 600;
}
.tag.won { background: var(--accent); color: var(--accent-ink); }
.empty { margin: 12px 0; color: var(--muted); }

.box { padding: 16px; background: var(--paper); border-radius: 12px; }
.winners { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.winners li { display: grid; padding: 12px; background: var(--gold); border-radius: 10px; color: var(--gold-ink); }
.winners strong { color: var(--ink); font-size: 1.15rem; overflow-wrap: anywhere; }

.poster { display: none; }

@media print {
  @page { size: A4 portrait; margin: 15mm; }
  body { background: #fff; }
  .admin > :not(.poster) { display: none !important; }
  .poster {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260mm;
    text-align: center;
  }
  .poster-title { margin: 0 0 8mm; font-size: 34pt; }
  .poster-text { margin: 6mm 0; font-size: 20pt; }
  .poster img { width: 130mm; height: 130mm; }
}
