/*
 * Tichá aukce: vzhled podle whaleden.com (Heebo 900 na nadpisy, Roboto na text,
 * modrá #007fc0, bílé karty s jemným stínem, štítky a tlačítka ve tvaru pilulky).
 * Mobil na prvním místě, bez externích knihoven kromě webových fontů.
 */

:root {
  --brand: #007fc0;          /* pozadí tlačítek (tučný velký text) */
  --brand-hover: #006aa3;
  --brand-text: #006ea8;     /* malý text a odkazy, kontrast ≥ 4,5:1 */
  --ink: rgba(0, 0, 0, 0.9);
  --ink-2: rgba(0, 0, 0, 0.68);
  --ink-3: rgba(0, 0, 0, 0.56);
  --line: #e2e8f0;
  --surface: #ffffff;
  --section: #f8fafc;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 4px 14px -4px rgba(15, 23, 42, 0.12);
  --shadow-btn: 0 20px 25px -5px rgba(0, 110, 180, 0.2), 0 8px 10px -6px rgba(0, 110, 180, 0.2);
  --font-head: 'Heebo', 'Roboto', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--section);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

a { color: var(--brand-text); font-weight: 500; }

img { max-width: 100%; display: block; }

button, input { font: inherit; letter-spacing: inherit; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--surface); padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.skip-link:focus { top: 12px; }

/* ---------- Hlavička a patička ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: center; align-items: center;
  height: 56px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.wordmark { display: block; line-height: 0; }
.wordmark img { height: 28px; width: auto; }

.site-footer {
  padding: 32px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  text-align: center; font-size: 14px; color: var(--ink-3); background: var(--surface);
}

/* ---------- Úvod ---------- */

.page {
  max-width: 1080px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}

.intro { text-align: center; padding: 8px 0 20px; }
.intro h1 { font-size: clamp(30px, 8vw, 46px); margin-top: 12px; }
.lead { margin-top: 10px; color: var(--ink-2); }

.tag {
  display: inline-block; padding: 0 12px; border: 1px solid var(--brand); border-radius: 999px;
  color: var(--brand-text); font-weight: 500; font-size: 14px; line-height: 28px;
  box-shadow: 0 10px 15px -3px rgba(0, 127, 192, 0.15), 0 4px 6px -4px rgba(0, 127, 192, 0.15);
  background: var(--surface);
}

/* ---------- Taby: karty obrazů ---------- */

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.tabs.is-single { grid-template-columns: minmax(0, 320px); justify-content: center; }

.tab-card {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  min-height: 44px; padding: 0 0 12px; margin: 0;
  background: var(--surface); color: inherit; border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; cursor: pointer;
  outline: 2px solid transparent; outline-offset: 0;
  transition: box-shadow 0.15s ease, outline-color 0.15s ease, transform 0.15s ease;
}
.tab-card:hover { box-shadow: var(--shadow); }
.tab-card[aria-selected="true"] { outline: 3px solid var(--brand); box-shadow: var(--shadow); }
.tab-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.tab-card.is-skeleton { min-height: 210px; cursor: default; background: linear-gradient(90deg, #eef2f6, #f8fafc, #eef2f6); }

/* Obraz celý, bez ořezu (i na výšku), na neutrálním pozadí. */
.tab-thumb {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface); margin-bottom: 8px;
  padding: 8px 8px 0;
}
.tab-title, .tab-amount, .tab-status { padding: 0 12px; }
.tab-title { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.tab-amount { font-family: var(--font-head); font-weight: 900; font-size: 22px; letter-spacing: -0.03em; line-height: 1.2; }
.tab-status { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.tab-badge {
  align-self: flex-start; margin: 4px 12px 0; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 22px; color: var(--ok); background: var(--ok-bg);
  border: 1px solid rgba(21, 128, 61, 0.35);
}
.tab-badge.is-outbid { color: var(--error); background: var(--error-bg); border-color: rgba(185, 28, 28, 0.35); }

/* Prázdný řádek upozornění nesmí ubírat mezeru mezi kartami a detailem obrazu. */
.notice-bar { margin: 0; text-align: center; font-weight: 500; }
.notice-bar:not(:empty) { margin: -12px 0 24px; padding: 10px 14px; border-radius: 10px; background: #eef6fb; }
.notice-bar.is-error:not(:empty) { color: var(--error); background: var(--error-bg); }
.notice-bar.is-ok:not(:empty) { color: var(--ok); background: var(--ok-bg); }

/* ---------- Panel vybraného obrazu ---------- */

.panel {
  display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "status" "action" "rules" "recent" "art";
}
.panel:focus { outline: none; }
.panel-head { grid-area: head; }
.status-card { grid-area: status; }
.action-card { grid-area: action; }
.recent-card { grid-area: recent; }
.rules { grid-area: rules; }
.art { grid-area: art; }

.panel-head h2 { font-size: clamp(28px, 7vw, 40px); overflow-wrap: anywhere; }
.art-meta { margin-top: 6px; color: var(--ink-2); overflow-wrap: anywhere; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }

.status-label { font-size: 14px; font-weight: 500; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.amount {
  font-family: var(--font-head); font-weight: 900; letter-spacing: -0.04em; line-height: 1.05;
  font-size: clamp(42px, 13vw, 60px); margin: 2px 0 6px; font-variant-numeric: tabular-nums;
}
.leader { color: var(--ink-2); overflow-wrap: anywhere; }
.leader strong { color: var(--ink); }
.countdown { margin-top: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.countdown .time { font-weight: 700; color: var(--ink); }
.countdown.is-soon .time { color: var(--error); }
.you-lead, .outbid {
  display: inline-block; margin-bottom: 8px; padding: 2px 12px; border-radius: 999px;
  font-weight: 700; color: var(--ok); background: var(--ok-bg); border: 1px solid rgba(21, 128, 61, 0.35);
}
.outbid { color: var(--error); background: var(--error-bg); border-color: rgba(185, 28, 28, 0.35); }

/* ---------- Formulář ---------- */

.bid-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
.bid-form fieldset:disabled { opacity: 0.55; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }

input[type="text"], input[type="email"] {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px; background: var(--surface); color: var(--ink);
  font-size: 17px;
}
input[type="text"]:focus, input[type="email"]:focus { border-color: var(--brand); outline: 3px solid rgba(0, 127, 192, 0.25); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--error); }

.amount-field { position: relative; }
.amount-field input {
  padding-right: 52px; font-family: var(--font-head); font-weight: 900; font-size: 26px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.amount-field .suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--ink-2);
}

.hint { font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.field-error { font-size: 15px; font-weight: 500; color: var(--error); line-height: 1.4; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick button {
  min-height: 44px; padding: 6px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid #cbd5e1; background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
}
.quick button:hover { border-color: var(--brand); color: var(--brand-text); }
.quick button[aria-pressed="true"] { border-color: var(--brand); background: #e6f3fa; color: var(--brand-text); }

.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; cursor: pointer; line-height: 1.45; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #eef2f6; color: var(--ink); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-block { width: 100%; }

/* Živé oblasti zůstávají v DOM i prázdné, jinak by je čtečky neohlásily. */
.form-message { font-weight: 500; }
.form-message:not(:empty) { margin-top: 14px; }
.form-message.is-ok { padding: 12px 14px; border-radius: 10px; color: var(--ok); background: var(--ok-bg); }
.form-message.is-error { padding: 12px 14px; border-radius: 10px; color: var(--error); background: var(--error-bg); }

.notice { margin-bottom: 14px; padding: 12px 14px; border-radius: 10px; background: #eef6fb; color: var(--ink); font-weight: 500; }

/* ---------- Poslední příhozy, obraz, pravidla ---------- */

.recent-card h3 { font-size: 22px; margin-bottom: 8px; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.recent li:first-child { border-top: 0; }
.recent .nick { font-weight: 700; overflow-wrap: anywhere; }
.recent .sum { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.recent .when { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); }
.muted { color: var(--ink-3); }

.art { margin: 0; }
.art figcaption, .confirm-item { overflow-wrap: anywhere; }
.art img {
  width: 100%; height: auto; border-radius: var(--radius); background: #e8eef3;
  box-shadow: var(--shadow); min-height: 120px;
}
.art figcaption { margin-top: 14px; color: var(--ink-2); white-space: pre-line; }

.rules h3 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 8px; }
.rules p { white-space: pre-line; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

.load-state { text-align: center; color: var(--ink-2); padding: 32px 0; }

/* ---------- Stav spojení a potvrzení ---------- */

.net-status {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 30; margin: 0; font-size: 14px; font-weight: 500; color: #fff;
}
.net-status:not(:empty) {
  padding: 6px 16px; border-radius: 999px; background: rgba(15, 23, 42, 0.86); box-shadow: var(--shadow-sm);
}

dialog:not([open]) { display: none; }

.confirm {
  width: min(92vw, 420px); padding: 0; border: 0; border-radius: 16px; box-shadow: var(--shadow);
  color: var(--ink);
}
.confirm::backdrop { background: rgba(15, 23, 42, 0.55); }
.confirm form { padding: 24px; text-align: center; }
.confirm-title { font-weight: 500; color: var(--ink-2); }
.confirm-amount {
  font-family: var(--font-head); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1;
  font-size: clamp(40px, 12vw, 56px); margin: 6px 0; font-variant-numeric: tabular-nums;
}
.confirm-item { color: var(--ink-2); margin-bottom: 20px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }

/* ---------- Širší obrazovky ---------- */

@media (min-width: 600px) {
  .tabs { gap: 16px; }
  .tab-title { font-size: 17px; }
  .tab-amount { font-size: 26px; }
  .card { padding: 24px; }
}

@media (min-width: 880px) {
  .page { padding-top: 32px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; margin-bottom: 44px; }
  .panel {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "art head" "art status" "art action" "art rules" "art recent";
    align-items: start; column-gap: 32px;
  }
  .art { grid-row: 1 / span 5; position: sticky; top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
