:root{
  --bg:#0b0c10; --panel:#12131a; --ink:#f2f3f7; --muted:#a7a9b4;
  --line:#1f2130; --fx:#181a24;
  --a:#00ffa3; --b:#7a5cff; --c:#ff2fd6;
  --pill:#1a1c28; --pillOn:#24273a;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 system-ui,Segoe UI,Roboto,Arial,sans-serif}

.wrap{max-width:1100px;margin:auto;padding:28px}
.topbar{display:flex;flex-wrap:wrap;align-items:end;gap:1rem;margin-bottom:1.25rem}
.topbar h1{margin:0;font-size:clamp(1.1rem,1rem+1.2vw,1.8rem);letter-spacing:.2px}
.title-input{display:grid;gap:.35rem;min-width:280px;flex:1}
.title-input span{font-size:.9rem;color:var(--muted)}
.title-input input{
  background:var(--panel);border:1px solid var(--line);border-radius:12px;
  padding:.8rem 1rem;color:var(--ink);outline:none;
  box-shadow:0 0 0 1px rgba(255,255,255,.02) inset, 0 6px 24px rgba(0,0,0,.35);
}
.title-input input:focus{border-color:var(--a);box-shadow:0 0 0 2px color-mix(in oklab,var(--a) 40%, transparent)}

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

.colhead, .rowhead{
  background:linear-gradient(135deg, #141624, #11131c);
  border:1px solid var(--line); border-radius:12px;
  padding:.7rem 1rem; color:var(--muted); font-weight:600;
}
.colhead{ text-align:center }

.cell{
  background:var(--panel);
  border:1px solid var(--line); border-radius:14px;
  padding:.6rem;
}

/* ====== Criterion (details) ====== */
.criterion{
  border-radius:10px; overflow:hidden;
  background:linear-gradient(180deg, var(--panel), #0f1020);
  border:1px solid #1a1c2a;
}
.criterion > summary{
  list-style:none; cursor:pointer; user-select:none;
  display:flex; align-items:center; justify-content:space-between; gap:.75rem;
  padding:.7rem .9rem;
  position:relative;
}
.criterion > summary::-webkit-details-marker{display:none}
.criterion > summary::after{
  content:"▾"; color:var(--muted); font-size:.95rem; transition:transform .2s ease;
}
.criterion[open] > summary::after{ transform:rotate(180deg) }

.crit-name{font-weight:700; letter-spacing:.2px}
.score-badge{
  display:inline-grid; place-items:center; min-width:2.2rem; height:2rem;
  padding:0 .35rem; border-radius:10px; border:1px solid var(--line);
  background:var(--fx); color:var(--muted); font-weight:700;
}

/* Body */
.criterion-body{padding:.6rem .9rem 1rem; display:grid; gap:.7rem}

/* Rating pills 1..10 */
.rating{
  display:flex; flex-wrap:wrap; gap:.35rem;
  margin:0; border:0; padding:0;
}
.rating label{
  background:var(--pill); border:1px solid #22243a; color:#cbd0df;
  border-radius:999px; padding:.45rem .6rem; cursor:pointer;
  transition:transform .06s ease, background .15s ease, border-color .15s ease;
}
.rating label:hover{ transform:translateY(-1px); background:var(--pillOn) }
.rating input{ appearance:none; width:0; height:0; position:absolute }
.rating input:checked + i{
  background: linear-gradient(135deg, var(--a), var(--c));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  font-weight:800;
}
.rating i{ font-style:normal; letter-spacing:.2px }

/* Nota */
.note{display:grid; gap:.35rem}
.note span{font-size:.85rem; color:var(--muted)}
.note textarea{
  display:none; /* aparece sólo si hay puntuación */
  background:#0e1020; color:var(--ink);
  border:1px solid #202338; border-radius:10px; resize:vertical;
  min-height:90px; padding:.7rem .8rem; outline:none;
}
.note textarea:focus{ border-color:var(--b); box-shadow:0 0 0 2px color-mix(in oklab,var(--b) 35%, transparent) }

/* Mostrar la nota cuando cualquier puntuación esté marcada */
.criterion:has(.rating input:checked) .note textarea{ display:block }
.criterion:has(.rating input:checked) .score-badge{
  color:#0a0b12; background:linear-gradient(135deg,var(--a),var(--c)); border-color:transparent;
}

/* Accesibilidad foco */
.criterion > summary:focus-visible{
  outline:2px solid var(--b); outline-offset:3px; border-radius:10px;
}

.foot{margin-top:18px; color:var(--muted); font-size:.9rem}

/* Responsive */
@media (max-width: 880px){
  .grid{ grid-template-columns: 1fr }
  .colhead:nth-child(n+2){ display:none }
  .rowhead{ order:-1 }
}

