:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --border: #334155;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1e293b 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

header.site {
  text-align: center;
  padding: 8px 0 4px;
}
header.site .badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

h1 { font-size: 28px; margin: 6px 0; }
h2 { font-size: 20px; margin: 0 0 12px; }
.muted { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-top: 20px;
}

/* Hlavní fotka + náhledy na veřejné stránce */
.gallery-card { padding: 14px; }
.main-photo {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-2);
  display: block;
}
.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.thumbs .thumb {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.65;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.thumbs .thumb:hover { opacity: 1; }
.thumbs .thumb.active { border-color: var(--accent); opacity: 1; }

.bid-status {
  text-align: center;
  padding: 6px 0 4px;
}
.bid-status .label { color: var(--muted); font-size: 14px; }
.bid-status .amount {
  font-size: 46px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin: 4px 0;
}
.bid-status .leader { color: var(--muted); font-size: 15px; }

.countdown {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.countdown .unit {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 62px;
  text-align: center;
}
.countdown .num { font-size: 26px; font-weight: 700; }
.countdown .cap { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

form { display: grid; gap: 12px; }
label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }
input, textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  background: var(--accent);
  transition: transform 0.05s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.hint { font-size: 13px; color: var(--muted); }
.privacy { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

.msg { border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-top: 4px; }
.msg.error { background: rgba(239, 68, 68, 0.15); color: #fecaca; border: 1px solid rgba(239,68,68,0.4); }
.msg.ok { background: rgba(34, 197, 94, 0.15); color: #bbf7d0; border: 1px solid rgba(34,197,94,0.4); }

.history { list-style: none; padding: 0; margin: 0; }
.history li {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history li:last-child { border-bottom: none; }
.history .h-name { font-weight: 600; }
.history .h-amount { color: var(--accent); font-weight: 700; }
.history .h-time { color: var(--muted); font-size: 12px; }

.banner {
  text-align: center; padding: 18px; border-radius: var(--radius);
  font-size: 18px; font-weight: 700; margin-top: 20px;
}
.banner.ended { background: rgba(148,163,184,0.15); border: 1px solid var(--border); }

/* ── Admin ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
tr.winner td { background: rgba(245, 158, 11, 0.12); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #0f172a; font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
a.link { color: var(--accent); }
.center { text-align: center; }

/* ── Náhledy fotek v adminu ── */
#photoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.photo-item { position: relative; }
.photo-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.photo-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 9px;
  font-size: 13px;
  border-radius: 8px;
  line-height: 1;
}
input[type="file"] {
  padding: 10px;
  cursor: pointer;
}
