:root {
  --bg: #16110d;
  --bg-2: #1e1813;
  --card: #241d16;
  --card-2: #2c241b;
  --line: #3a2f24;
  --amber: #d9a441;
  --amber-soft: #f0c476;
  --peat: #8a6a3f;
  --cream: #f2e9dc;
  --muted: #a4917a;
  --green: #7fae6a;
  --red: #c96a58;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(217, 164, 65, .13), transparent 60%),
    radial-gradient(ellipse at 90% 110%, rgba(138, 106, 63, .10), transparent 55%);
  background-attachment: fixed;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 20px 16px 120px; }
.wrap.wide { max-width: 1080px; }

h1, h2, h3 { font-weight: 650; letter-spacing: -.02em; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
a { color: var(--amber-soft); }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--peat); margin-bottom: 18px;
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }
.spacer { height: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 14px; }
.card.flat { box-shadow: none; background: var(--bg-2); }

label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }

input[type=text], input[type=date], textarea, select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 17px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > * { flex: 1 1 auto; min-width: 140px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--amber);
  color: #241a09;
  border: none;
  border-radius: 11px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter .12s ease, transform .06s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost, .btn.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
button.ghost:hover { background: var(--card-2); }
button.danger { background: transparent; color: var(--red); border: 1px solid rgba(201, 106, 88, .4); }
button.full, .btn.full { width: 100%; }
button.sm { padding: 9px 13px; font-size: 14px; border-radius: 9px; }

.pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.pill.live { color: var(--green); border-color: rgba(127, 174, 106, .35); }
.pill.warn { color: var(--amber-soft); border-color: rgba(217, 164, 65, .35); }

/* --- skala ocen --- */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 4px 0 6px; }
.scale button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 21px;
  font-weight: 600;
  padding: 0;
  height: 58px;
  border-radius: 12px;
}
.scale button[aria-pressed=true] {
  background: var(--amber);
  color: #241a09;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, .22);
}
.scale-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* --- tagi --- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags button {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 13px; font-size: 14.5px; font-weight: 500; border-radius: 999px;
}
.tags button[aria-pressed=true] { background: rgba(217, 164, 65, .16); color: var(--amber-soft); border-color: rgba(217, 164, 65, .5); }

/* --- listy / rankingi --- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: none; }
.rank-no {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: var(--card-2); color: var(--muted);
}
.rank-no.gold { background: var(--amber); color: #241a09; }
.rank-no.silver { background: #9aa0a6; color: #1c1c1c; }
.rank-no.bronze { background: #a9744a; color: #1c1c1c; }
.grow { flex: 1; min-width: 0; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Jak .ellip, ale zamiast obcinac do jednej linii, lamie do dwoch - do
   nazw prob na liscie TOP3, gdzie pierwsze slowo bywa wspolne dla kilku
   prob (np. ta sama destylarnia) i samo nie wystarcza do rozroznienia. */
.ellip2 {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; white-space: normal; word-break: break-word;
}
.val { font-variant-numeric: tabular-nums; font-weight: 650; }

.qr-mini { background: var(--cream); padding: 8px; border-radius: 10px; line-height: 0; flex: none; }
.qr-mini svg { width: 76px; height: 76px; display: block; }

.bar { height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--peat), var(--amber)); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(22, 17, 13, 0), var(--bg) 35%);
  padding: 22px 16px 16px;
}
.sticky-bar .inner { max-width: 620px; margin: 0 auto; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px);
  background: var(--card-2); border: 1px solid var(--line); color: var(--cream);
  padding: 11px 18px; border-radius: 999px; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 50;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(201, 106, 88, .6); color: #f0b3a6; }

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 34px; letter-spacing: .2em; font-weight: 700; color: var(--amber);
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 16px; text-align: center;
}

.step-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; }
.step-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; }
.step-dots i.on { background: var(--amber); }
.step-dots i.done { background: var(--peat); }

.hero-num { font-size: 42px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--amber); }

.notice {
  border-left: 3px solid var(--amber);
  background: rgba(217, 164, 65, .07);
  padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 14.5px;
}
.notice.alert { border-color: var(--red); background: rgba(201, 106, 88, .08); }

.pick-slot {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px dashed var(--line);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 10px;
}
.pick-slot.filled { border-style: solid; border-color: rgba(217, 164, 65, .45); background: rgba(217, 164, 65, .07); cursor: grab; }
.pick-slot .medal { font-size: 19px; width: 28px; flex: none; text-align: center; }
.pick-slot.drop-hover { border-color: var(--amber); background: rgba(217, 164, 65, .22); box-shadow: 0 0 0 2px var(--amber) inset; }

.choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--cream);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 9px;
  font-size: 16px; font-weight: 500; text-align: left; justify-content: flex-start;
  cursor: grab;
}
.choice[aria-pressed=true] { border-color: var(--amber); background: rgba(217, 164, 65, .12); }
.choice .idx { color: var(--muted); font-size: 13px; width: 26px; flex: none; }

.drag-ghost { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999;
  opacity: .92; box-shadow: 0 10px 28px rgba(0,0,0,.45); border-radius: 12px; }

@media print {
  body { background: #fff; color: #000; }
  .noprint { display: none !important; }
  .card { border-color: #ccc; box-shadow: none; background: #fff; }
  .muted, th { color: #555; }
}
