
:root{
  --bg:#0f1115; --panel:#171a21; --muted:#c9d3e3; --text:#f1f5fb;
  --accent:#8bd17c; --danger:#ff6b6b; --secondary:#3b82f6;
  --card:#1d232f; --shadow:0 6px 18px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text);font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif}
a{color:#cfe3ff;text-decoration:none}
a.active{color:#fff;font-weight:700}
header.app{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #232939;background:#121620;position:sticky;top:0;z-index:5}
header .brand{font-weight:800}
nav{display:flex;gap:10px;flex-wrap:wrap}
nav a{padding:6px 10px;border-radius:8px;background:#19202f}
.stats{display:flex;gap:8px;color:#c8d1dc;flex-wrap:wrap}
.stats div{background:#141924;padding:6px 10px;border-radius:10px}
main{max-width:1100px;margin:0 auto;padding:12px}
.panel{background:var(--panel);padding:12px;border-radius:12px;box-shadow:var(--shadow);margin-bottom:12px; color: var(--text);}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.card{background:var(--card);border-radius:12px;padding:10px;box-shadow:var(--shadow)}
.card .thumb{width:100%;aspect-ratio:16/12;border-radius:10px;background:#0b0e14;display:grid;place-items:center;overflow:hidden;border:1px solid #1b2231}
.card .thumb img{width:100%;height:100%;object-fit:contain}
dialog{
  border:none;
  border-radius:12px;
  background:var(--panel);
  color:var(--text);             /* ensure light text inside */
  padding:14px;
}
dialog h3{ margin:0 0 8px 0; color:var(--text); }
dialog .small{ color:var(--muted); }
dialog::backdrop{ background: rgba(0,0,0,.55); }  /* dim the page behind */

/* Generic media thumb (used in Market rows) */
.thumb{
  width:160px;
  aspect-ratio:1/1;
  border-radius:10px;
  background:#0b0e14;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid #1b2231;
}
.thumb img{ width:100%; height:100%; object-fit:contain; }

/* === Rosette overlays on dog thumbnails === */
.card { position: relative; }
.thumb { position: relative; }
.badge { 
  position: absolute; 
  z-index: 30;         /* above rosettes & ticket badge */
  pointer-events: none;
  padding: 4px 8px; 
  border-radius: 8px; 
  font-size: 12px;
}
.rosette-badges{
  position:absolute; left:6px; bottom:6px;
  display:flex; gap:6px; align-items:center;
  background:rgba(11,14,20,.55); padding:4px 6px; border-radius:8px;
  backdrop-filter: blur(3px);
}
.rosette{ display:flex; align-items:center; gap:4px; font-size:12px; line-height:1; }
.rosette svg{ width:14px; height:14px; display:block; }
.badge-ticket{
  position:absolute; right:6px; bottom:6px;
  background:rgba(11,14,20,.65); color:#dfe8ff;
  padding:3px 6px; border-radius:8px; font-size:12px; backdrop-filter: blur(3px);
}

/* Result dialog */
.result-dialog{ width:min(680px, 92vw); }
.result-list{ margin:8px 0 0 0; padding:0; list-style:none; }
.result-list li{ padding:4px 0; display:flex; gap:8px; }
.result-list .pos{ width:38px; text-align:right; font-weight:700; }
.result-hero{
  width:100%; height:120px; border-radius:10px; margin-bottom:8px;
  background:#0b0f16 center/cover no-repeat; border:1px solid #1b2231;
}


/* Market row layout */
.market .panel{ display:flex; align-items:center; gap:12px; }
.market .info{ flex:1; min-width:220px; }

.kv{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;font-size:.9rem;color:#cdd6e3}
.kv div{background:#161b25;padding:6px 8px;border-radius:8px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
button{border:0;padding:9px 12px;border-radius:10px;background:var(--accent);color:#0b111a;font-weight:700;cursor:pointer;min-height:40px}
button.secondary{background:var(--secondary);color:#fff}
button.danger{background:var(--danger);color:#181a20}
select,input{background:#0f1420;border:1px solid #263046;color:#dbe7ff;border-radius:8px;padding:6px 8px}
.flash{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);background:#111826;color:#d9e2ef;padding:8px 12px;border-radius:10px;box-shadow:0 8px 18px rgba(0,0,0,.4);z-index:9998}
.small{font-size:.9rem;color:#c8d1dc}
