:root{
  --bg:#07070a; --text:#f2f2f7; --muted:#a7a7b6;
  --panel: rgba(18,19,27,.72);
  --border: rgba(120,120,170,.18);
  --border2: rgba(200,200,255,.12);
  --shadow: 0 25px 80px rgba(0,0,0,.65);
  --r: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(133,90,255,.22), transparent 60%),
    radial-gradient(1200px 600px at 80% 10%, rgba(0,200,255,.14), transparent 55%),
    var(--bg);
}

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

.wrap{max-width:1200px; margin:0 auto; padding:18px}

/* --- Topbar --- */
.topbar{
  position:sticky; top:0; z-index:30;
  background: rgba(7,7,10,.72);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
}

.header{
  display:flex; gap:16px; align-items:flex-start; justify-content:space-between;
  flex-wrap:wrap;
}

.brand{flex:1; min-width: 280px}
.titleRow{display:flex; gap:12px; align-items:center; justify-content:space-between}
h1{margin:0; font-size:18px; letter-spacing:.2px}
.sub{margin:6px 0 0; color:var(--muted); font-size:13px}
.count{margin-top:8px; color:var(--muted); font-size:12px}

.controls{
  display:flex; gap:10px; flex-wrap:wrap;
  justify-content:flex-end; align-items:center;
}

.input,.select,.btn{
  border:1px solid var(--border);
  background: var(--panel);
  color:var(--text);
  border-radius: 12px;
  padding:10px 12px;
  font-size:13px;
  outline:none;
}

.input{width:min(340px, 80vw)}
.input:focus,.select:focus{
  border-color: rgba(133,90,255,.55);
  box-shadow: 0 0 0 6px rgba(133,90,255,.10);
}

.select:disabled{opacity:.55}

.btn{
  cursor:pointer; user-select:none;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover{
  background: rgba(18,19,27,.95);
  border-color: rgba(133,90,255,.35);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.btn:active{transform: scale(.98)}

.seg{
  display:flex;
  border:1px solid var(--border);
  border-radius:999px;
  overflow:hidden;
  background: rgba(18,19,27,.55);
}
.seg button{
  border:0; background:transparent; color:var(--muted);
  padding:10px 12px; font-size:12px; cursor:pointer;
  transition: background .2s ease, color .2s ease;
  min-width:56px;
}
.seg button.active{background: rgba(255,255,255,.08); color: var(--text)}

.noscript{
  border:1px solid rgba(255,120,120,.35);
  background: rgba(255,120,120,.08);
  padding:12px 14px;
  border-radius: 14px;
  margin: 14px 0;
  color: #ffd7d7;
  font-size: 13px;
}

/* --- Grid: max 4 per rad + kort max 150px --- */
.grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
  padding:18px 0 30px;
  justify-items:center;
}

@media (min-width: 560px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(4, 1fr); }
}

.card{
  width: min(150px, 44vw);
  border:1px solid var(--border);
  background: rgba(15,16,22,.55);
  border-radius: var(--r);
  padding:10px;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  transition: transform .14s ease, border-color .2s ease, box-shadow .2s ease;
  display:flex; flex-direction:column; gap:8px;

  opacity:1;
  transform: translateY(10px);
  animation: pop .55s cubic-bezier(.2,.9,.2,1) both;
  animation-delay: var(--d, 0ms);
}

@media (min-width: 560px){
  .card{ width: min(150px, 28vw); }
}
@media (min-width: 900px){
  .card{ width: 150px; }
}

@keyframes pop{to{transform: translateY(0)}}

.card:hover{
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(0,200,255,.30);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.thumb{
  border-radius: 14px;
  overflow:hidden;
  background: rgba(0,0,0,.25);
  aspect-ratio: 150 / 265; /* korrekt för dina bilder */
  position:relative;
}

.thumb::after{
  content:"";
  position:absolute; inset:-40%;
  background:
    radial-gradient(circle at 30% 20%, rgba(133,90,255,.22), transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(0,200,255,.16), transparent 45%);
  opacity:0;
  transition: opacity .25s ease;
  pointer-events:none;
}

.card:hover .thumb::after{opacity:1}

.thumb img{
  width:100%; height:100%;
  object-fit:cover; /* byt till contain om du vill se hela kortet med marginal */
  transform: scale(1.02);
  transition: transform .28s ease;
  display:block;
}
.card:hover .thumb img{transform: scale(1.07)}

.name{font-size:11px; line-height:1.2; min-height:28px}
.meta{font-size:10px; color:var(--muted)}

/* --- Nummer-badge top center --- */
.badge{
  position:absolute;
  top:8px;
  left:50%;
  transform: translateX(-50%);
  z-index:2;

  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  letter-spacing:.6px;
  font-weight:700;

  background: rgba(8,8,12,.65);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);

  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);

  pointer-events:none;
}
.badge.major{ border-color: rgba(133,90,255,.28); }
.badge.minor{ border-color: rgba(0,200,255,.22); }

/* --- Modal --- */
.overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  display:none;
  align-items:center; justify-content:center;
  padding:14px;
  z-index:100;
}
.overlay.open{display:flex; animation: fade .18s ease both}
@keyframes fade{from{opacity:0}to{opacity:1}}

.modal{
  width:min(1100px, 98vw);
  border:1px solid var(--border2);
  background: rgba(10,11,16,.92);
  border-radius: 26px;
  overflow:hidden;
  box-shadow: var(--shadow);
  animation: modalIn .22s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes modalIn{from{transform:scale(.96);opacity:0}to{transform:scale(1);opacity:1}}

.modalInner{display:flex; flex-direction:column}
@media (min-width: 900px){ .modalInner{flex-direction:row} }

.left{
  background: rgba(18,19,27,.55);
  border-bottom:1px solid var(--border);
}
@media (min-width: 900px){
  .left{width:52%; border-right:1px solid var(--border); border-bottom:none}
}

.leftTop,.leftBottom{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px;
}
.leftTop{border-bottom:1px solid var(--border)}
.leftBottom{border-top:1px solid var(--border)}

.modalTitle{font-weight:650; font-size:14px}
.navBtns{display:flex; gap:8px; align-items:center}

.stage{
  position:relative;
  width:100%;
  aspect-ratio: 150 / 265;
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(900px 400px at 50% 10%, rgba(133,90,255,.14), transparent 55%),
    rgba(0,0,0,.25);
  touch-action: none;
}
.stage img{
  width:100%; height:100%;
  object-fit:contain;
  user-select:none;
  -webkit-user-drag:none;
  filter: drop-shadow(0 18px 50px rgba(0,0,0,.55));
  transition: opacity .18s ease;
}

.right{padding:16px}
@media (min-width: 900px){ .right{width:48%; padding:18px} }

.pillRow{display:flex; gap:8px; flex-wrap:wrap}
.pill{
  font-size:11px; color:var(--muted);
  border:1px solid var(--border);
  background: rgba(18,19,27,.55);
  padding:6px 10px;
  border-radius:999px;
}

.section{margin-top:14px}
.section h2{margin:0; font-size:14px}
.desc{
  margin-top:8px;
  color:#e5e5f1;
  font-size:13.5px;
  line-height:1.55;
}

/* Styling för stycken (när JS matar in <p>) */
.desc p{margin:0 0 10px}
.desc p:last-child{margin-bottom:0}

.boxes{margin-top:14px; display:grid; grid-template-columns:1fr; gap:12px}
@media (min-width: 560px){ .boxes{grid-template-columns:1fr 1fr} }

.box{
  border:1px solid var(--border);
  background: rgba(18,19,27,.45);
  border-radius: 18px;
  padding:12px;
}
.boxtitle{font-size:11px; color:var(--muted); font-weight:700}
.chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.chip{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.07);
}
.hint{margin-top:12px; color:var(--muted); font-size:12px}

/* Lite bättre tapp-target på mobil */
@media (max-width: 480px){
  .btn{padding:12px 14px}
  .input,.select{padding:12px 14px}
}
