/* Favorites — aligned with Speed Stars rose-gold / bright-red UI */

.game-favorite-btn{position:relative;box-sizing:border-box;line-height:1}
.game-favorite-btn .favorite-icon{width:18px;height:18px;flex-shrink:0;display:block}
.game-favorite-btn .favorite-icon--on{display:none}
.game-favorite-btn .favorite-icon--off path{stroke:currentColor;fill:none}
.GAME-toolbar-btn.game-favorite-btn .favorite-icon{width:20px;height:20px}
.GAME-toolbar-btn.game-favorite-btn .favorite-icon--off path,
.GAME-toolbar-btn.game-favorite-btn .favorite-icon--on path{fill:none;stroke:currentColor}
.GAME-toolbar-btn.game-favorite-btn.is-favorited .favorite-icon--on path{fill:currentColor;stroke:none}

.game-favorite-btn.is-favorited{
  background:rgba(255,59,59,.28)!important;
  border-color:rgba(255,59,59,.55)!important;
  color:var(--text)!important;
  box-shadow:inset 0 0 0 1px rgba(255,59,59,.2)
}
.game-favorite-btn.is-favorited:hover{
  background:rgba(255,59,59,.4)!important;
  border-color:rgba(255,59,59,.7)!important;
  color:var(--text)!important
}
.game-favorite-btn.is-favorited .favorite-icon--off{display:none}
.game-favorite-btn.is-favorited .favorite-icon--on{display:block}
.game-favorite-btn.is-favorited .favorite-icon--on path{fill:var(--bright-red)}

.GAME-toolbar-btn.game-favorite-btn{
  width:auto;min-width:40px;height:40px;padding:0 12px;gap:8px;
  background:rgba(183,110,121,.2);border:1px solid var(--card-border);border-radius:8px;color:var(--text-secondary)
}
.GAME-toolbar-btn.game-favorite-btn:hover{background:rgba(183,110,121,.4);color:var(--text)}
.GAME-toolbar-btn.game-favorite-btn .game-favorite-btn__label{
  font-size:14px;font-weight:600;color:inherit;white-space:nowrap
}
.GAME-toolbar-btn.game-favorite-btn.is-favorited{
  background:rgba(255,59,59,.3)!important;
  border-color:rgba(255,59,59,.58)!important;
  color:var(--text)!important;
  box-shadow:inset 0 0 0 1px rgba(255,59,59,.24)
}
.GAME-toolbar-btn.game-favorite-btn.is-favorited:hover{
  background:rgba(255,59,59,.44)!important;color:var(--text)!important
}
@media(max-width:640px){
  .GAME-toolbar-btn.game-favorite-btn{width:40px;padding:0;gap:0}
  .GAME-toolbar-btn.game-favorite-btn .game-favorite-btn__label{display:none}
}

#controls-actions .game-favorite-btn{
  height:48px;box-sizing:border-box;padding:0 16px;gap:8px;line-height:1
}
#controls-actions .game-favorite-btn__label{
  font-size:.875rem;font-weight:600;white-space:nowrap;line-height:1;color:inherit
}
#controls-actions .game-favorite-btn.is-favorited{
  background:linear-gradient(135deg,var(--rose-gold),var(--bright-red))!important;
  border-color:transparent!important;color:#111!important;box-shadow:0 8px 18px rgba(0,0,0,.25)
}
#controls-actions .game-favorite-btn.is-favorited .favorite-icon--on path{fill:#111}
#controls-actions .game-favorite-btn.is-favorited .game-favorite-btn__label{color:#111}
@media(max-width:640px){
  #controls-actions .game-favorite-btn__label{font-size:.72rem}
}

.site-header__tools,
.nav-tools{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-width:0;width:100%}
.game-favorites{position:relative;flex:0 0 auto}

/* Header trigger — match search pill + rose-gold accent */
.game-favorites__trigger{
  display:inline-flex;align-items:center;gap:.45rem;height:38px;box-sizing:border-box;
  padding:0 .85rem;line-height:1;
  border:1px solid rgba(255,255,255,.12);border-radius:9999px;
  background:#1e293b;color:#e5e7eb;font-size:.82rem;font-weight:700;cursor:pointer;
  transition:border-color .18s,background .18s,box-shadow .18s,transform .12s ease,color .18s
}
.game-favorites__trigger:hover{
  border-color:rgba(183,110,121,.55);
  background:#334155;color:#fff
}
.game-favorites__trigger:active{transform:scale(.97)}
.game-favorites__trigger:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(255,59,59,.28)}
.game-favorites__trigger--open{
  border-color:rgba(255,59,59,.5);
  background:rgba(183,110,121,.18);
  color:#fff;
  box-shadow:0 0 0 1px rgba(255,59,59,.18)
}
.game-favorites__trigger--has-items .game-favorites__trigger-heart{color:var(--bright-red)}
.game-favorites__trigger--open .game-favorites__trigger-chevron{transform:rotate(180deg)}
.game-favorites__trigger-heart{
  display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--rose-gold)
}
.game-favorites__trigger-icon{width:1rem;height:1rem;flex-shrink:0;display:block;transition:transform .25s ease}
.game-favorites__trigger--open .game-favorites__trigger-icon{transform:scale(1.08)}
.game-favorites__trigger-label{
  max-width:5.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:inherit
}
.game-favorites__trigger-badge{
  display:inline-flex;align-items:center;justify-content:center;min-width:1.15rem;height:1.15rem;padding:0 .3rem;
  border-radius:99px;font-size:.62rem;font-weight:800;line-height:1;color:#fff;
  background:linear-gradient(135deg,var(--rose-gold),var(--bright-red));
  box-shadow:0 2px 8px rgba(255,59,59,.35);
  animation:favBadgePop .35s ease
}
.game-favorites__trigger-badge[hidden]{display:none!important}
@keyframes favBadgePop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
.game-favorites__trigger-chevron{
  width:.85rem;height:.85rem;flex-shrink:0;opacity:.55;transition:transform .22s ease,opacity .2s;color:inherit
}
.game-favorites__trigger--open .game-favorites__trigger-chevron{opacity:.9}

.game-favorites__dropdown{
  display:flex;flex-direction:column;position:absolute;top:calc(100% + 8px);right:0;z-index:10060;
  width:18.5rem;max-width:min(18.5rem,calc(100vw - 1.5rem));
  max-height:min(24rem,62vh);overflow:visible;padding:0;
  border:1px solid rgba(255,255,255,.12);border-radius:12px;
  background:#1e293b;
  box-shadow:0 12px 32px rgba(0,0,0,.45);
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translateY(-8px) scale(.97);transform-origin:top right;
  transition:opacity .22s ease,transform .22s ease,visibility .22s
}
.game-favorites__dropdown[hidden]{display:none!important}
.game-favorites__dropdown::before{content:'';position:absolute;left:0;right:0;bottom:100%;height:12px}
.game-favorites__dropdown--open{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0) scale(1)}

/* Scrollable list area; the quick-actions footer stays pinned below it */
.game-favorites__body{
  flex:1 1 auto;min-height:0;display:flex;flex-direction:column;
  overflow:hidden;border-radius:12px 12px 0 0
}

.game-favorites__panel-head{
  display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  padding:.55rem .85rem .45rem;border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(183,110,121,.14),transparent)
}
.game-favorites__panel-title{font-size:.78rem;font-weight:800;letter-spacing:.02em;color:#fff}
.game-favorites__panel-count{
  font-size:.68rem;font-weight:700;padding:.15rem .45rem;border-radius:99px;
  color:#fff;background:linear-gradient(135deg,var(--rose-gold),var(--bright-red))
}

.game-favorites__list{
  flex:1 1 auto;min-height:0;
  overflow-x:hidden;overflow-y:auto;padding:.35rem 0;
  scrollbar-width:thin;scrollbar-color:rgba(100,116,139,.55) rgba(15,23,42,.35)
}
.game-favorites__list::-webkit-scrollbar{width:6px;height:0}
.game-favorites__list::-webkit-scrollbar-track{background:transparent;margin:4px 0}
.game-favorites__list::-webkit-scrollbar-thumb{
  background:rgba(100,116,139,.5);border-radius:100px;border:1px solid rgba(15,23,42,.35)
}
.game-favorites__list--reordering{overflow-x:hidden;overflow-y:hidden;touch-action:none}

.game-favorites__empty-state{
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:.35rem;padding:1.1rem 1rem 1.25rem
}
.game-favorites__empty-icon{
  display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:999px;
  color:#fff;background:linear-gradient(135deg,var(--rose-gold),var(--bright-red));
  box-shadow:0 8px 20px rgba(0,0,0,.25);margin-bottom:.15rem
}
.game-favorites__empty-icon svg{width:1.25rem;height:1.25rem;display:block}
.game-favorites__empty-title{margin:0;font-size:.88rem;font-weight:800;color:#fff}
.game-favorites__empty-hint{
  margin:0;font-size:.78rem;font-weight:600;line-height:1.45;color:#94a3b8;max-width:14rem
}

.game-favorites__item{
  display:flex;align-items:stretch;gap:.25rem;padding:.1rem .35rem;
  min-width:0;max-width:100%;box-sizing:border-box
}
.game-favorites__list.is-entering .game-favorites__item{animation:favItemIn .28s ease both}
.game-favorites__item.is-swapping{position:relative;z-index:2;will-change:transform;pointer-events:none}
@keyframes favItemIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
.game-favorites__item.is-removing{animation:favItemOut .22s ease forwards}
@keyframes favItemOut{to{opacity:0;transform:translateY(-2px);max-height:0;padding:0;margin:0}}

.game-favorites__item-link{
  flex:1;min-width:0;overflow:hidden;display:flex;align-items:center;gap:10px;
  padding:8px 12px;border-radius:8px;text-decoration:none;color:#e5e7eb;
  font-size:.86rem;font-weight:600;line-height:1.25;background:transparent;transition:background .12s
}
.game-favorites__item-link:hover,
.game-favorites__item-link:focus{background:#334155;outline:none}
.game-favorites__item-link img{
  width:28px;height:28px;object-fit:cover;border-radius:6px;flex-shrink:0;border:1px solid rgba(255,255,255,.1)
}
.game-favorites__item-link span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Row, not column: stacked buttons make the remove button easy to mis-tap on phones */
.fav-list__actions{
  display:flex;flex-direction:row;justify-content:center;align-items:center;align-self:center;
  gap:.3rem;flex-shrink:0;padding:.15rem .1rem
}
.fav-list__act{
  display:inline-flex;align-items:center;justify-content:center;width:1.65rem;height:1.65rem;padding:0;
  border:1px solid var(--card-border);border-radius:.4rem;background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.7);cursor:pointer;
  transition:background .15s,color .15s,border-color .15s,transform .1s
}
.fav-list__act:active:not(:disabled){transform:scale(.92)}
.fav-list__act svg{display:block;flex-shrink:0;pointer-events:none}
.fav-list__act:hover:not(:disabled){
  background:rgba(183,110,121,.2);color:#fff;border-color:rgba(183,110,121,.45)
}
.fav-list__act--remove:hover:not(:disabled){
  background:rgba(255,59,59,.18);color:#ff6b6b;border-color:rgba(255,59,59,.4)
}
.fav-list__act:disabled{opacity:.35;cursor:default}

/* Pinned quick actions (Install to Desktop / Google preferred) */
.fav-menu-actions{
  flex-shrink:0;display:flex;flex-direction:column;gap:.25rem;
  padding:.4rem .45rem .5rem;
  border-top:1px solid rgba(255,255,255,.1);border-radius:0 0 12px 12px;
  background:linear-gradient(180deg,rgba(183,110,121,.1),rgba(18,9,11,.5))
}
.fav-menu-actions:empty{display:none}
.fav-menu-actions__btn{
  display:flex;align-items:center;gap:.6rem;width:100%;box-sizing:border-box;
  padding:.5rem .6rem;border:1px solid transparent;border-radius:.5rem;
  background:transparent;color:rgba(255,255,255,.86);
  font-family:inherit;font-size:.8rem;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;
  transition:background .15s,color .15s,border-color .15s,transform .1s
}
.fav-menu-actions__btn:hover{
  background:rgba(183,110,121,.2);border-color:rgba(183,110,121,.45);color:#fff
}
.fav-menu-actions__btn:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(255,59,59,.35)}
.fav-menu-actions__btn:active{transform:scale(.98)}
.fav-menu-actions__btn[hidden]{display:none!important}
.fav-menu-actions__btn--install{color:#f3d792}
.fav-menu-actions__btn--install:hover{
  background:rgba(201,162,39,.2);border-color:rgba(201,162,39,.5);color:#fff
}
.fav-menu-actions__icon{width:22px;height:22px;flex-shrink:0;display:block}
.fav-menu-actions__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.game-favorites-toast{
  position:fixed;top:1rem;left:50%;z-index:9999;display:inline-flex;align-items:center;gap:.45rem;
  max-width:min(22rem,calc(100vw - 2rem));padding:.55rem .9rem;border-radius:.65rem;
  font-size:.82rem;font-weight:700;color:#fff;background:rgba(18,9,11,.96);
  border:1px solid rgba(183,110,121,.4);box-shadow:0 10px 28px rgba(0,0,0,.45);
  transform:translate(-50%,-12px);opacity:0;pointer-events:none;
  transition:opacity .22s ease,transform .22s ease
}
.game-favorites-toast--show{opacity:1;transform:translate(-50%,0)}
.game-favorites-toast__icon{color:var(--bright-red);flex-shrink:0;display:inline-flex}
.game-favorites-toast__icon svg{width:1rem;height:1rem;display:block}

@media(max-width:767px){
  .game-favorites__trigger-label{display:none}
  .site-header__tools .site-header__game-search{flex:1;width:auto;max-width:none}
  .game-favorites{position:static}
  .game-favorites__dropdown{
    position:fixed;left:.5rem;right:.5rem;width:auto;max-width:none;
    top:60px;transform-origin:top center;z-index:10070
  }
  .game-favorites__list{max-height:min(16rem,50vh)}
}
@media(min-width:768px){
  .site-header__tools{width:auto;gap:12px}
  .site-header__tools .site-header__game-search{width:12rem;flex-shrink:0}
}
