:root{
  --bg: #0e1016;
  --bg-soft: #121522;
  --card: rgba(255,255,255,0.06);
  --card-hover: rgba(255,255,255,0.10);
  --stroke: rgba(255,255,255,0.12);
  --text: #e8eaf2;
  --muted: #aeb4c4;
  --gold: #ffd76a;
  --accent: #7cc8ff;
  --success: #7ee787;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 10% 0%, #1a1f3a 0%, transparent 60%),
    radial-gradient(1000px 600px at 90% -10%, #172235 0%, transparent 55%),
    var(--bg);
  font: 400 16px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); border:0;
}

.container{ width:min(1200px, 92vw); margin-inline:auto; }

.site-header{
  position: sticky; top:0; z-index:10;
  backdrop-filter: saturate(1.3) blur(10px);
  background: linear-gradient(180deg, rgba(8,10,18,.7), rgba(8,10,18,.3));
  border-bottom: 1px solid var(--stroke);
}

.header-inner{
  display:flex; align-items:center; gap:24px; padding:20px 0;
  justify-content:space-between;
}

.brand{
  display:flex; flex-direction:column; margin:0; line-height:1;
  letter-spacing:.5px;
  text-transform:uppercase;
  font-family: Cinzel, serif;
}
.brand-top{
  font-weight:800; font-size:22px; color:var(--gold);
  text-shadow: 0 2px 12px rgba(255,215,106,.25);
}
.brand-bottom{
  font-weight:600; font-size:14px; color:var(--muted);
}

.toolbar{
  display:grid; grid-template-columns: 1fr auto auto; gap:10px; width:min(680px, 100%);
}
.field select, .field input{
  width:100%; appearance:none;
  background: var(--card); border:1px solid var(--stroke);
  color:var(--text);
  padding:12px 14px; border-radius: 12px;
  outline: none; transition: .2s border-color, .2s background;
}
.field input::placeholder{ color:#94a0b8; }
.field select:focus, .field input:focus{ border-color: var(--accent); background: var(--card-hover); }

.subbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 0 12px 0; gap:12px; color:var(--muted); font-size:14px;
}
.link-btn{
  background:none; border:none; color:var(--accent); cursor:pointer; padding:6px 8px; border-radius:8px;
}
.link-btn:hover{ text-decoration:underline; }

.monster-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap:18px; padding:26px 0 56px;
}

.monster-card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
  display:flex; flex-direction:column; gap:10px; align-items:center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  outline: none;
}
.monster-card:focus-visible{ border-color: var(--accent); }
.monster-card:hover{ transform: translateY(-4px); background: var(--card-hover); }

.media{
  width:100%; aspect-ratio: 1 / 1; display:grid; place-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: 12px; overflow:hidden; border:1px dashed rgba(255,255,255,.08);
}
.monster-card img{
  width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}

.name{
  margin:6px 0 0; font-weight:600; font-size:1rem; text-align:center;
}
.etape{ margin:0; color:var(--muted); font-size:.92rem; }

.actions{ margin-top:auto; width:100%; display:flex; justify-content:center; }
.copy-btn{
  background: linear-gradient(180deg, #20263a, #1a2033);
  border:1px solid var(--stroke);
  color:var(--text); padding:10px 14px; border-radius: 10px; cursor:pointer;
  transition: transform .15s ease, border-color .2s, background .2s, color .2s;
}
.copy-btn:hover{ transform: translateY(-1px); border-color: var(--accent); }
.copy-btn.copied{ background:#1f2f23; border-color:#275f39; color: var(--success); }

.skeleton{
  animation: pulse 1.1s ease-in-out infinite alternate;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.1), rgba(255,255,255,.06));
  background-size: 200% 100%;
}
@keyframes pulse { to { background-position: -200% 0; } }

.card-skeleton{
  height: 290px; border-radius: var(--radius); border:1px solid var(--stroke);
}

.toast{
  position: fixed; left:50%; bottom:24px; transform: translateX(-50%) translateY(20px);
  background: rgba(17, 25, 40, .9); color:var(--text); border:1px solid var(--stroke);
  padding:10px 14px; border-radius: 10px; opacity:0; pointer-events:none; transition: .25s;
  box-shadow: var(--shadow);
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

.toolbar select,
.toolbar select option {
  color: var(--text);
  background-color: var(--bg-soft);
}
.toolbar select option:checked {
  background: var(--accent);
  color: #000;
}

@supports (-webkit-appearance: none) {
  .toolbar select { -webkit-appearance: none; }
}
.toolbar select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 760px){
  .header-inner{ flex-direction:column; align-items:flex-start; gap:12px; }
  .brand{ align-items:flex-start; }
  .toolbar{ width:100%; grid-template-columns: 1fr 1fr; }
  .toolbar .field:nth-child(3){ grid-column: span 2; }
}