:root{
  --bg:#0f172a;      /* abans #0b1220 – ara una mica més suau */
  --panel:#111827;
  --card:#111827;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --brand:#38bdf8;
  --accent:#22c55e;
  --danger:#ef4444;
  --warn:#f59e0b;
  --border:#1f2937;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text)
}

header.appbar{
  position:sticky;
  top:0;
  z-index:10;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:10px 16px;
  background:linear-gradient(90deg,#0f172a,#0b1220);
  border-bottom:1px solid var(--border)
}

.brand{display:flex;align-items:center;gap:12px}
.menu-toggle{
  display:none;
  border:none;
  background:transparent;
  color:var(--text);
  font-size:22px;
  cursor:pointer;
  padding:4px 6px;
  border-radius:8px;
}
.menu-toggle:hover{
  background:rgba(148,163,184,.15);
}
.logo{
  width:42px;height:42px;border-radius:12px;overflow:hidden;
  background:#0ea5e9;display:grid;place-items:center;box-shadow:var(--shadow)
}
.title{font-weight:800;letter-spacing:.3px}
.clock{color:var(--muted);font-weight:600;justify-self:end}

.layout{
  display:grid;
  grid-template-columns:250px 1fr;
  min-height:calc(100vh - 64px)
}
aside{
  background:var(--panel);
  border-right:1px solid var(--border);
  padding:14px
}
main{padding:18px}

.menu-title{
  font-size:12px;color:#7dd3fc;
  text-transform:uppercase;letter-spacing:.12em;
  margin:8px 6px
}
.menu a{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:#bae6fd;
  text-decoration:none;
  border:1px solid transparent
}
.menu a:hover{background:#0b1220;border-color:#0ea5e933}
.menu a.active{
  background:#0ea5e915;border-color:#0ea5e944;color:#e0f2fe
}

.wrap{max-width:1100px;margin:0 auto}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:var(--shadow);
  margin-bottom:14px
}
.card h3{margin:0 0 8px 0;font-size:16px}
.card.light{
  background:#0f172a;
  border-color:#1f2937;
}

.muted{color:var(--muted)}
.pill{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  color:#a5b4fc;
  background:#1e293b
}

.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}

.ex{
  grid-column:span 12;
  background:#1e293b;
  border:1px solid #334155;
  border-radius:14px;
  padding:12px;
}

.ex-subtitle{
  font-size:13px;
  color:#facc15;        /* groc clar */
  margin-top:4px;
  margin-bottom:6px;
  opacity:0.95;
}

.ex-head{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:8px
}
.ex-title{font-weight:700}
.ex-body{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center
}

.inp, select, textarea{
  background:#0b1220;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px
}
textarea{min-height:64px;width:100%}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #0ea5e9;
  background:#0ea5e9;
  color:#02121c;
  font-weight:800;
  cursor:pointer
}
.btn.secondary{
  background:#111827;
  color:#e5e7eb;
  border-color:#334155
}
.btn.light{
  background:#93c5fd;
  color:#0b1220;
  border-color:#93c5fd
}
.btn[disabled]{
  opacity:.5;
  cursor:not-allowed
}

.feedback{
  margin-top:8px;
  padding:8px 10px;
  border-radius:10px;
  font-size:14px
}
.ok{
  background:#052e1a;
  border:1px solid #14532d;
  color:#86efac
}
.err{
  background:#3b0a0a;
  border:1px solid #7f1d1d;
  color:#fecaca
}
.score{font-weight:900;color:#a7f3d0}

.match-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center
}
.match-row > span{
  min-width:120px;
  display:inline-block
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center
}

#timerBox{
  font-variant-numeric:tabular-nums;
}

.question-nav{
  margin-top:12px;
  display:flex;
  gap:8px;
  justify-content:space-between;
  align-items:center
}

.question-nav-left{display:flex;gap:8px;align-items:center}
.question-nav-right{display:flex;gap:8px;align-items:center}

/* Verbs */
#verbsWrap.vgrid{
  display:flex;
  flex-direction:column;
  gap:12px
}
.vcard{
  background:#020617;
  border:1px solid #1f2937;
  border-radius:14px;
  padding:10px 12px
}
.vcard-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
  gap:10px;
  flex-wrap:wrap
}
.vcard-header small{
  color:var(--muted);
  font-size:12px
}

.vtables-wrap{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px
}
.vtable{
  width:100%;
  border-collapse:collapse;
  font-size:13px
}
.vtable th,
.vtable td{
  border-bottom:1px solid #1f2937;
  padding:3px 4px;
  text-align:left;
  white-space:nowrap
}
.vtable th{
  color:#bfdbfe;
  font-weight:600;
}

.vtable caption{
  text-align:left;
  font-weight:600;
  margin-bottom:2px;
  color:#e5e7eb;
}

/* Mòbil */
@media (max-width: 900px){
  .layout{grid-template-columns:1fr}
  aside{
    position:absolute;
    top:64px;
    left:0;
    right:0;
    z-index:20;
    display:none;         /* amagat per defecte al mòbil */
  }
  .layout.menu-open aside{
    display:block;        /* es mostra quan cliques el menú */
  }
  .menu-toggle{
    display:inline-flex;  /* botó hamburguesa visible al mòbil */
  }

   .ex-title {
    font-size: 1.5rem; /* Aumentem la mida en un 40% (de 1rem a 1.4rem) */
    color: white; /* Assegurem que la lletra sigui blanca */
  }

  .ex-subtitle {
    font-size: 1.2rem; /* Augmentem la mida de la traducció */
  }

  .inp, select {
    font-size: 1rem; /* Augmentem la mida de la font per a l'input/select */
    padding: 12px; /* Augmentem l'espai intern */
  }

  .question-nav {
    margin-top: 16px;
  }

  .question-nav-left, .question-nav-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .btn {
    width: 100%; /* Els botons omplen tota la pantalla */
    margin-bottom: 10px; /* Espai entre els botons */
  }

  /* Botó de comprovar centrat a uns 200px de la part inferior */
  .question-nav-right button {
    margin-top: 200px; 
    width: 100%;
  }

  .question-nav-left button {
    margin-right: 10px;
  }
}
