:root {
  color-scheme:dark;
  --bg:#10191d;
  --surface:#18272e;
  --surface2:#22343c;
  --line:#31464e;
  --text:#f2f6f2;
  --muted:#a9bfc4;
  --accent:#d1f58a;
  --green:#99e3bf;
  --red:#ffa9a2;
  --shadow:0 12px 40px #0002;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  min-height:100vh;
  background:radial-gradient(ellipse at 70% 0%,#20352f 0,transparent 380px),var(--bg);
  color:var(--text);
  font-size:15px;
  line-height:1.45;
}

button,input,select {
  font:inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color:transparent;
}

a {
  color:var(--accent);
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

button {
  cursor:pointer;
  color:var(--text);
  border:1px solid var(--line);
  background:var(--surface2);
  border-radius:13px;
  padding:12px 15px;
  font-weight:650;
}

button:disabled {
  opacity:.5;
  cursor:default;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.primary {
  background:var(--accent);
  border-color:var(--accent);
  color:#182415;
}

.ghost {
  background:transparent;
}

.danger {
  color:var(--red);
}

.small {
  font-size:12px;
}

.muted {
  color:var(--muted);
}

.eyebrow {
  font-size:11px;
  font-weight:800;
  letter-spacing:1.5px;
  text-transform:uppercase;
  color:var(--accent);
}

.wrap {
  max-width:760px;
  margin:auto;
  padding:20px 18px 110px;
}

.top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:9px 0 30px;
}

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

.logo {
  height:42px;
  width:42px;
  border-radius:13px;
  background:var(--accent);
  display:grid;
  place-items:center;
  color:#14251e;
  font-size:26px;
  font-weight:900;
}

.brand strong {
  font-size:20px;
  letter-spacing:-.7px;
}

.brand small {
  display:block;
  color:var(--muted);
  font-size:10px;
  letter-spacing:1.7px;
}

.pill {
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}

h1 {
  font-size:clamp(32px,7vw,46px);
  line-height:1.05;
  letter-spacing:-1.9px;
  margin:10px 0 12px;
}

h2 {
  font-size:22px;
  letter-spacing:-.5px;
  margin:0 0 13px;
}

h3 {
  font-size:16px;
  margin:0 0 10px;
}

p {
  margin:0 0 12px;
}

.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:21px;
  padding:17px;
  margin:16px 0;
  box-shadow:var(--shadow);
}

.fields {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.full {
  grid-column:1/-1;
}

label {
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:650;
  margin-bottom:6px;
}

input,select {
  width:100%;
  background:#102026;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:11px;
  min-height:45px;
  padding:11px 12px;
  font-size:16px;
  min-width:0;
}

input::placeholder {
  color:#81979c;
}

.wide {
  width:100%;
}

.row {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.between {
  justify-content:space-between;
}

.section {
  margin-top:24px;
}

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

.result {
  padding:10px;
  text-align:left;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:15px;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:stretch;
}

.art {
  aspect-ratio:245/337;
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,#283f43,#132329);
  overflow:hidden;
  border-radius:9px;
  min-width:0;
}

.art img {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.placeholder {
  color:var(--muted);
  text-align:center;
  padding:10px;
  font-size:12px;
}

.result strong {
  margin:8px 0 2px;
  white-space:normal;
  overflow-wrap:anywhere;
}

.result .small {
  font-weight:400;
}

.detail-head {
  display:grid;
  grid-template-columns:130px 1fr;
  gap:17px;
  align-items:center;
}

.detail-head h1 {
  font-size:30px;
  letter-spacing:-1px;
  margin:5px 0 7px;
}

.price {
  font-size:36px;
  font-weight:850;
  letter-spacing:-1.4px;
  color:var(--accent);
  line-height:1.1;
  margin:7px 0;
}

.stats {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}

.stat {
  background:#112128;
  border-radius:13px;
  padding:13px;
  min-width:0;
}

.stat small {
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-bottom:4px;
}

.stat strong {
  font-size:18px;
  overflow-wrap:anywhere;
}

.up {
  color:var(--green);
}

.down {
  color:var(--red);
}

.nav {
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:#14232aee;
  backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
  padding:8px 12px calc(9px + env(safe-area-inset-bottom));
  display:flex;
  justify-content:center;
  z-index:5;
}

.nav button {
  background:transparent;
  border:0;
  color:var(--muted);
  font-size:12px;
  flex:1;
  max-width:120px;
  min-width:0;
  padding:8px 10px;
  display:grid;
  gap:3px;
  justify-items:center;
}

.nav button[aria-current="page"] {
  color:var(--accent);
}

.nav svg {
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.notice {
  padding:12px 13px;
  border:1px solid #76683d;
  background:#3a3323;
  color:#f7dca0;
  border-radius:12px;
  margin:12px 0;
  font-size:13px;
}

.notice[hidden] {
  display:none;
}

.entry {
  display:grid;
  grid-template-columns:60px 1fr;
  align-items:start;
  gap:12px;
  padding:13px 0;
  border-bottom:1px solid var(--line);
}

.entry:last-child {
  border-bottom:0;
}

.entry .actions {
  margin-top:8px;
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}

.entry .actions button {
  font-size:12px;
  padding:7px 9px;
}

.collection-top {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.bar {
  height:8px;
  border-radius:5px;
  background:#30434a;
  overflow:hidden;
}

.bar>span {
  display:block;
  height:100%;
  background:var(--accent);
  border-radius:5px;
}

.metric {
  display:grid;
  grid-template-columns:64px 1fr 74px;
  gap:9px;
  align-items:center;
  margin:10px 0;
  font-size:12px;
}

.metric b {
  text-align:right;
}

.footer {
  font-size:11px;
  color:var(--muted);
  margin-top:24px;
  line-height:1.6;
}

.view[hidden], [hidden] {
  display:none!important;
}

.back {
  margin:0 0 14px;
  padding:8px 12px;
}

.toast {
  position:fixed;
  bottom:92px;
  left:50%;
  transform:translateX(-50%);
  background:var(--accent);
  color:#152515;
  padding:12px 18px;
  border-radius:14px;
  max-width:90%;
  z-index:10;
  font-weight:650;
  box-shadow:0 8px 30px #0006;
}

.links {
  display:grid;
  gap:10px;
}

.links a {
  display:block;
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px;
  font-weight:650;
}

.note {
  font-size:12px;
  color:var(--muted);
  line-height:1.6;
}

.demo-btn {
  margin-top:12px;
  font-size:13px;
}

.empty {
  text-align:center;
  padding:30px 10px;
  color:var(--muted);
}

.split {
  display:flex;
  gap:10px;
}

.split>* {
  flex:1;
}

.prompt {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:13px;
  background:#102026;
  padding:13px;
  border:1px solid var(--line);
  border-radius:10px;
  max-height:180px;
  overflow:auto;
}

details summary {
  cursor:pointer;
  color:var(--accent);
  font-weight:650;
}

@media(min-width:620px) {
  .result-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .detail-head {
    grid-template-columns:175px 1fr;
  }
  .wrap {
    padding:28px 25px 110px;
  }
}

@media(max-width:350px) {
  .detail-head {
    grid-template-columns:100px 1fr;
  }
  .price {
    font-size:28px;
  }
  .fields {
    grid-template-columns:1fr;
  }
  .nav button {
    padding:8px 4px;
  }
}

/* Signály z dat v detailu karty */
.signal {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.signal:last-of-type {
  border-bottom: 0;
}

.signal .note {
  margin: 4px 0 0;
}

/* Formulář úpravy položky ve sbírce */
.editor {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

details summary {
  font-size: 13px;
}

/* Graf vlastní historie ceny */
.chart {
  position: relative;
}

.chart svg {
  display: block;
  overflow: visible;
  touch-action: pan-y;
}

.chart svg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-crosshair {
  stroke: var(--muted);
  stroke-width: 1;
}

.chart-focus {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-tooltip {
  position: absolute;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.chart-tooltip strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.chart-tooltip span {
  color: var(--muted);
  font-size: 11px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}

.history-table th {
  color: var(--muted);
  font-weight: 650;
}

/* Seznam přání */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--green);
  color: #10251b;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.status-good {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--green);
  font-weight: 700;
}

.wish-alert {
  border: 1px solid var(--green);
  background: #1d3a30;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 13px;
  margin: 12px 0;
  font-size: 14px;
}

/* Doplňování setů */
.set-row {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0;
}

.result.owned {
  border-color: var(--green);
}

.result.missing .art {
  opacity: .55;
}

/* Porovnání dvou karet */
.compare {
  overflow-x: auto;
  padding: 12px;
}

.compare table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.compare th,
.compare td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.compare tbody th {
  color: var(--muted);
  font-weight: 650;
  width: 34%;
}

.compare thead th:first-child {
  width: 34%;
}

.compare-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}
