:root{
      --bg: #0b0f17;
      --panel: rgba(255,255,255,0.06);
      --panel2: rgba(255,255,255,0.10);
      --text: rgba(255,255,255,0.92);
      --muted: rgba(255,255,255,0.65);
      --line: rgba(255,255,255,0.14);
      --shadow: 0 18px 60px rgba(0,0,0,0.55);
      --radius: 18px;
      --radius2: 14px;
    }

    *{ box-sizing:border-box; }
    body{
      margin:0;
      min-height:100vh;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
      color:var(--text);
      background:
        radial-gradient(1000px 600px at 10% 10%, rgba(125, 83, 255, 0.16), transparent 60%),
        radial-gradient(900px 600px at 90% 30%, rgba(0, 208, 255, 0.14), transparent 55%),
        radial-gradient(900px 600px at 40% 90%, rgba(255, 80, 160, 0.12), transparent 60%),
        var(--bg);
    }

    header{
      padding:28px 18px 10px;
      max-width:1100px;
      margin:0 auto;
      display:flex;
      gap:14px;
      align-items:flex-end;
      justify-content:space-between;
      flex-wrap:wrap;
    }
    .title{
      display:flex;
      flex-direction:column;
      gap:6px;
    }
    h1{
      margin:0;
      font-size:22px;
      letter-spacing:0.2px;
    }
    .subtitle{
      margin:0;
      color:var(--muted);
      font-size:13px;
      line-height:1.35;
    }

    .controls{
      display:flex;
      gap:10px;
      align-items:center;
      flex-wrap:wrap;
    }

    .chip{
      padding:9px 10px;
      border:1px solid var(--line);
      background:var(--panel);
      border-radius:999px;
      font-size:12px;
      color:var(--muted);
      display:flex;
      align-items:center;
      gap:8px;
      user-select:none;
    }
    .chip strong{ color:var(--text); font-weight:650; }

    .btn{
      cursor:pointer;
      border:1px solid var(--line);
      background:linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
      color:var(--text);
      border-radius:999px;
      padding:10px 12px;
      font-size:13px;
      display:inline-flex;
      align-items:center;
      gap:8px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.25);
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
      user-select:none;
    }
    .btn:hover{
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.22);
      background:linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
    }
    .btn:active{ transform: translateY(0px); }

    main{
      max-width:1100px;
      margin:0 auto;
      padding:16px 18px 38px;
      display:grid;
      grid-template-columns: 1.15fr 0.85fr;
      gap:16px;
    }
    @media (max-width: 920px){
      main{ grid-template-columns: 1fr; }
    }

    .cardStage{
      border:1px solid var(--line);
      background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
      border-radius: var(--radius);
      padding:18px;
      box-shadow: var(--shadow);
      position:relative;
      overflow:hidden;
      min-height:520px;
      display:grid;
      place-items:center;
    }

    .card{
      width:min(390px, 92%);
      border-radius: 22px;
      border:1px solid rgba(255,255,255,0.18);
      background:
        radial-gradient(700px 420px at 15% 20%, rgba(255,255,255,0.12), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
      box-shadow: 0 24px 70px rgba(0,0,0,0.6);
      overflow:hidden;
      transform: translateZ(0);
      cursor:pointer;
    }

    .cardTop{
      padding:14px 14px 10px;
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:10px;
      border-bottom:1px solid rgba(255,255,255,0.12);
    }
    .cardName{
      font-weight:800;
      letter-spacing:0.2px;
      line-height:1.1;
      font-size:16px;
    }
    .cardTypePill{
      padding:8px 10px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,0.16);
      background: rgba(0,0,0,0.18);
      font-size:12px;
      color:var(--muted);
      white-space:nowrap;
    }
    .cardTypePill b{ color:var(--text); font-weight:750; }

    .art{
      aspect-ratio: 3 / 4;
      width:100%;
      background: rgba(0,0,0,0.20);
      display:grid;
      place-items:center;
      border-bottom:1px solid rgba(255,255,255,0.10);
      position:relative;
    }
    .card.hasDesc .art{
      aspect-ratio: 3 / 3.45;
    }
    .art img{
      width:100%;
      height:100%;
      object-fit:cover;
      display:block;
    }
    .art .fallback{
      padding:26px 18px;
      text-align:center;
      color:var(--muted);
      font-size:13px;
    }

    .desc{
      padding:10px 14px 12px;
      border-bottom:1px solid rgba(255,255,255,0.10);
      color:rgba(255,255,255,0.82);
      font-size:13px;
      line-height:1.35;
      background: rgba(0,0,0,0.16);
    }

    .stats{
      display:flex;
      justify-content:space-between;
      gap:10px;
      padding:12px 14px 14px;
      align-items:center;
    }
    .statBlock{
      flex:1;
      border:1px solid rgba(255,255,255,0.12);
      background: rgba(0,0,0,0.18);
      border-radius: var(--radius2);
      padding:10px 10px;
      text-align:center;
    }
    .statLabel{
      font-size:11px;
      letter-spacing:0.6px;
      color:var(--muted);
      text-transform:uppercase;
      margin-bottom:4px;
    }
    .statValue{
      font-size:18px;
      font-weight:850;
      letter-spacing:0.3px;
    }

    .side{
      border:1px solid var(--line);
      background: var(--panel);
      border-radius: var(--radius);
      padding:16px;
      box-shadow: 0 10px 40px rgba(0,0,0,0.35);
      height: fit-content;
    }

    .side h2{
      margin:0 0 10px;
      font-size:15px;
      letter-spacing:0.2px;
    }

    .kv{
      display:grid;
      grid-template-columns: 110px 1fr;
      gap:8px 10px;
      font-size:13px;
      padding-top:6px;
    }
    .k{ color:var(--muted); }
    .v{ color:var(--text); }

    .pillRow{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-top:10px;
    }
    .pill{
      padding:7px 10px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,0.14);
      background: rgba(0,0,0,0.18);
      color:rgba(255,255,255,0.78);
      font-size:12px;
    }

    .filterSection{
      margin-top:12px;
      padding-top:12px;
      border-top:1px solid rgba(255,255,255,0.12);
    }
    .filterSection h3{
      margin:0 0 8px;
      font-size:12px;
      letter-spacing:0.6px;
      color:var(--muted);
      text-transform:uppercase;
    }
    .filterRow{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
    }
    .filterBtn{
      cursor:pointer;
      padding:7px 10px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,0.14);
      background: rgba(0,0,0,0.18);
      color:rgba(255,255,255,0.78);
      font-size:12px;
      user-select:none;
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .filterBtn:hover{
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.22);
      background: rgba(0,0,0,0.24);
    }
    .filterBtn.active{
      border-color: rgba(140,210,255,0.75);
      background: rgba(70,160,255,0.20);
      color: rgba(255,255,255,0.92);
    }

    .resultsSection{
      margin-top:12px;
      padding-top:12px;
      border-top:1px solid rgba(255,255,255,0.12);
    }
    .resultsHeader{
      display:flex;
      align-items:baseline;
      justify-content:space-between;
      gap:10px;
      margin-bottom:8px;
    }
    .resultsHeader h3{
      margin:0;
      font-size:12px;
      letter-spacing:0.6px;
      color:var(--muted);
      text-transform:uppercase;
    }
    .resultsCount{
      font-size:12px;
      color:var(--muted);
    }
    .resultsList{
      display:flex;
      flex-direction:column;
      gap:8px;
      max-height:320px;
      overflow:auto;
      padding-right:4px;
    }
    .resultItem{
      cursor:pointer;
      text-align:left;
      width:100%;
      border:1px solid rgba(255,255,255,0.12);
      background: rgba(0,0,0,0.18);
      border-radius: 12px;
      padding:9px 10px;
      color:rgba(255,255,255,0.86);
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .resultItem:hover{
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.22);
      background: rgba(0,0,0,0.24);
    }
    .resultItem.active{
      border-color: rgba(140,210,255,0.75);
      background: rgba(70,160,255,0.18);
    }
    .resultTitle{
      font-weight:750;
      font-size:13px;
      line-height:1.15;
      margin-bottom:3px;
    }
    .resultMeta{
      font-size:12px;
      color: rgba(255,255,255,0.62);
      line-height:1.2;
    }

    .empty{
      padding:18px;
      border:1px dashed rgba(255,255,255,0.22);
      border-radius: var(--radius);
      color: var(--muted);
      line-height:1.5;
      background: rgba(0,0,0,0.18);
    }

    .hint{
      margin-top:12px;
      font-size:12px;
      color:var(--muted);
      line-height:1.4;
    }

    .smallLink{
      color:rgba(140,210,255,0.95);
      text-decoration:none;
    }
    .smallLink:hover{ text-decoration:underline; }
