:root{
  --ma-bg:#fff;
  --ma-text:#111;
  --ma-muted:#6b7280;
  --ma-line:#e5e7eb;
  --ma-soft:#f3f4f6;
  --ma-radius:16px;
  --ma-shadow: 0 10px 25px rgba(0,0,0,.06);
}

.ma-wrap{ color:var(--ma-text); background:var(--ma-bg); }

.ma-head{
  display:grid;
  gap:16px;
}

.ma-title{
  margin:0;
  font-size:24px;
  line-height:1.2;
}

/* The search field takes what the filters leave (they are optional: no blank when one is missing). */
.ma-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.ma-filters .ma-input{
  flex: 1 1 220px;
  min-width: 0;
}

.ma-lang-flag{
  display:inline-block;
  vertical-align:middle;
  border-radius:2px;
}

.ma-input,
.ma-select{
  border:1px solid var(--ma-line);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  min-height:40px;
}

.ma-input{
  width:min(360px, 70vw);
}


.ma-empty{
  margin-top:18px;
  padding:16px;
  border:1px solid var(--ma-line);
  border-radius:var(--ma-radius);
  color:var(--ma-muted);
}

.ma-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}

@media (max-width:980px){
  .ma-grid{
    grid-template-columns:repeat(2, 1fr);
  }
}

@media (max-width:640px){
  .ma-grid{
    grid-template-columns:1fr;
  }
}

.ma-card{
  border:1px solid var(--ma-line);
  border-radius:var(--ma-radius);
  overflow:hidden;
  background:#fff;
  box-shadow:var(--ma-shadow);
  display:flex;
  gap:0;
}

.ma-cover{
  position:relative;
  width:170px;
  background:var(--ma-soft);
}

@media (max-width:640px){
  .ma-cover{
    width:140px;
  }
}

.ma-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.ma-cover--ph{
  width:100%;
  height:100%;
  min-height:140px;
  background:linear-gradient(180deg,#f3f4f6,#e5e7eb);
}

/* PLAY / PAUSE buttons (GRID mode only) */

.ma-card .ma-play,
.ma-card .ma-pause{
  position:absolute;
  inset:auto 10px 10px auto;
  border:1px solid var(--ma-line);
  background:#fff;
  border-radius:999px;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  cursor:pointer;
}

.is-hidden{
  display:none !important;
}

.ma-meta{
  padding:12px;
  min-width:0;
  flex:1;
}

.ma-author{
  font-size:12px;
  color:var(--ma-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ma-name{
  font-size:15px;
  font-weight:700;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ma-tag{
  display:inline-block;
  margin-top:8px;
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--ma-soft);
  color:var(--ma-muted);
}

.ma-desc{
  margin-top:8px;
  font-size:12px;
  color:var(--ma-muted);
  line-clamp:2;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.ma-pager{
  margin-top:16px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}

.ma-pager__info{
  color:var(--ma-muted);
  font-size:13px;
}

.ma-player{
  position:fixed;
  left:12px;
  right:12px;
  bottom:12px;
  border:1px solid var(--ma-line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--ma-shadow);
  padding:10px;
  display:flex;
  gap:10px;
  align-items:center;
  z-index:999;
}

.ma-player__cover{
  width:44px;
  height:44px;
  border-radius:12px;
  background:var(--ma-soft);
  background-size:cover;
  background-position:center;
  border:1px solid var(--ma-line);
}

.ma-player__info{
  min-width:0;
  flex:1;
}

.ma-player__author{
  font-size:12px;
  color:var(--ma-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ma-player__title{
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ma-player__audio{
  width:min(520px,45vw);
}

@media (max-width:820px){
  .ma-player__audio{
    width:40vw;
  }
}

@media (max-width:640px){
  .ma-player__audio{
    width:52vw;
  }
}

.ma-player__close{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--ma-line);
  background:#fff;
  cursor:pointer;
}

.ma-card.is-playing,
.ma-list-item.is-playing{
  outline:2px solid #111;
  background:#fafafa;
}

.ma-card:hover,
.ma-list-item:hover{
  background:#fafafa;
}

/* VIEW SWITCH */

.ma-view-switch{
  display:flex;
  gap:8px;
  align-items:center;
}

.ma-view-switch .btn.is-active{
  opacity:1;
  pointer-events:none;
}

/* LIST MODE */

.ma-list{
  margin-top: 16px;
  display:grid;
  gap:14px;
}

.ma-list-item{
  display:grid;
  grid-template-columns:84px 1fr auto;
  gap:16px;
  align-items:center;
  padding:14px;
  border:1px solid #ddd;
  border-radius:14px;
  background:#fff;
}

.ma-list-item__cover{
  width:84px;
  height:84px;
  border-radius:12px;
  overflow:hidden;
  background:#f3f3f3;
}

.ma-list-item__cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.ma-list-item__body{
  min-width:0;
}

.ma-list-item__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}

/* PLAY / PAUSE buttons in LIST mode */

.ma-list-item__actions .ma-play,
.ma-list-item__actions .ma-pause{
  position:static;
  inset:auto;
  width:44px;
  height:44px;
  border:1px solid var(--ma-line);
  background:#fff;
  border-radius:999px;
  display:grid;
  place-items:center;
  cursor:pointer;
  flex:0 0 auto;
}

@media (max-width:640px){
  .ma-player{
    flex-wrap:wrap;
  }

  .ma-player__audio{
    width:100%;
  }
}

@media (max-width:700px){

  .ma-list-item{
    grid-template-columns:72px 1fr;
  }

  .ma-list-item__actions{
    grid-column:1 / -1;
    justify-content:flex-start;
  }

  .ma-list-item__cover{
    width:72px;
    height:72px;
  }
}
/* Dynamic filters: the list is being reloaded */
.ma-results{
  transition: opacity .15s ease;
}

.ma-wrap.is-loading .ma-results{
  opacity: .55;
}
