/* shared/next-action.css — Loop-Closer Sheet nach Match-Ende
   Namespace: .pfb-nxt-*
   z-index: 9500 (unter reward-overlay 10000, über chat 9999 nicht nötig —
                  nextAction erscheint erst nach reward-overlay close)
   Deps: shared/base.css vars (--amber, --amber-hi, --cream, --black, --safe-bottom)
*/

/* ─── Backdrop ─────────────────────────────────────────────────────────── */
#pfb-nxt {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background:
    radial-gradient(ellipse at center bottom, rgba(245,176,48,0.18), rgba(6,4,0,0.78) 70%),
    rgba(6,4,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#pfb-nxt.pfb-nxt-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop: Mittig als Modal statt Bottom-Sheet */
@media (min-width: 720px) {
  #pfb-nxt {
    align-items: center;
    padding: 24px;
  }
}

/* ─── Sheet Container ──────────────────────────────────────────────────── */
.pfb-nxt-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #1a0f02 0%, #0b0600 100%);
  border-top: 3px solid var(--amber, #D4920A);
  border-left: 3px solid var(--amber, #D4920A);
  border-right: 3px solid var(--amber, #D4920A);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  color: var(--cream, #FFF3D0);
  padding: 10px 18px calc(22px + var(--safe-bottom, 0px));
  box-shadow:
    0 -8px 40px rgba(6,4,0,0.6),
    0 0 60px rgba(245,176,48,0.18),
    inset 0 1px 0 rgba(255,243,208,0.12);
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(.2,1.05,.4,1);
  will-change: transform;
}
#pfb-nxt.pfb-nxt-visible .pfb-nxt-sheet {
  transform: translateY(0);
}
.pfb-nxt-sheet.pfb-nxt-dragging {
  transition: none;
}

/* Desktop: centered modal, full rounded, with border all around */
@media (min-width: 720px) {
  .pfb-nxt-sheet {
    border: 3px solid var(--amber, #D4920A);
    border-radius: 20px;
    padding: 22px 22px 22px;
    transform: translateY(24px) scale(0.92);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(.2,1.4,.4,1), opacity 0.22s ease;
  }
  #pfb-nxt.pfb-nxt-visible .pfb-nxt-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Reduced-motion: no slide */
#pfb-nxt.pfb-nxt-no-anim .pfb-nxt-sheet {
  transition: none;
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ─── Grabber (mobile swipe-down affordance) ──────────────────────────── */
.pfb-nxt-grabber {
  width: 44px;
  height: 4px;
  background: rgba(255,243,208,0.28);
  border-radius: 2px;
  margin: 0 auto 10px;
}
@media (min-width: 720px) {
  .pfb-nxt-grabber { display: none; }
}

/* ─── Close button ────────────────────────────────────────────────────── */
.pfb-nxt-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(245,176,48,0.4);
  background: rgba(6,4,0,0.55);
  color: var(--cream, #FFF3D0);
  font-family: 'DM Mono', monospace;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.pfb-nxt-close:hover,
.pfb-nxt-close:focus-visible {
  background: rgba(245,176,48,0.18);
  border-color: var(--amber-hi, #F5B030);
  transform: scale(1.06);
  outline: none;
}
.pfb-nxt-close:active { transform: scale(0.94); }

/* ─── Eyebrow + Headline ──────────────────────────────────────────────── */
.pfb-nxt-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--amber-hi, #F5B030);
  text-transform: uppercase;
  text-align: center;
  margin-top: 2px;
  opacity: 0;
  animation: pfb-nxt-fade 0.3s ease 0.06s forwards;
}
.pfb-nxt-headline {
  font-family: 'Anton', sans-serif;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--cream, #FFF3D0);
  text-transform: uppercase;
  text-align: center;
  margin: 4px 0 14px;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  opacity: 0;
  animation: pfb-nxt-fade 0.3s ease 0.1s forwards;
}
@media (min-width: 720px) {
  .pfb-nxt-headline { font-size: 1.9rem; margin-bottom: 18px; }
}

@keyframes pfb-nxt-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Grid of action cards ────────────────────────────────────────────── */
.pfb-nxt-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1fr;
}
.pfb-nxt-grid.pfb-nxt-grid-2 {
  grid-template-columns: 1fr 1fr;
}
/* Tiny phones: stack to single column */
@media (max-width: 359px) {
  .pfb-nxt-grid,
  .pfb-nxt-grid.pfb-nxt-grid-2,
  .pfb-nxt-grid.pfb-nxt-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ─── Action Card ─────────────────────────────────────────────────────── */
.pfb-nxt-card {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 16px 10px 14px;
  min-height: 128px;
  background: linear-gradient(180deg, rgba(245,176,48,0.10) 0%, rgba(245,176,48,0.03) 100%);
  border: 2px solid rgba(245,176,48,0.45);
  border-radius: 14px;
  color: var(--cream, #FFF3D0);
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.18s ease, background 0.18s ease;
  opacity: 0;
  transform: translateY(6px);
  animation: pfb-nxt-rise 0.26s ease forwards;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.pfb-nxt-card:nth-child(1) { animation-delay: 0.14s; }
.pfb-nxt-card:nth-child(2) { animation-delay: 0.22s; }
.pfb-nxt-card:nth-child(3) { animation-delay: 0.30s; }
@keyframes pfb-nxt-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pfb-nxt-card:hover,
.pfb-nxt-card:focus-visible {
  border-color: var(--amber-hi, #F5B030);
  background: linear-gradient(180deg, rgba(245,176,48,0.22) 0%, rgba(245,176,48,0.08) 100%);
  box-shadow: 0 0 24px rgba(245,176,48,0.35), inset 0 0 14px rgba(245,176,48,0.12);
  outline: none;
}
.pfb-nxt-card:active {
  transform: scale(0.975);
}

/* Primary card (Revanche) gets stronger amber fill */
.pfb-nxt-card-revenge {
  background: linear-gradient(180deg, rgba(245,176,48,0.28) 0%, rgba(212,146,10,0.10) 100%);
  border-color: var(--amber-hi, #F5B030);
}
.pfb-nxt-card-revenge:hover,
.pfb-nxt-card-revenge:focus-visible {
  background: linear-gradient(180deg, rgba(245,176,48,0.42) 0%, rgba(212,146,10,0.18) 100%);
  box-shadow: 0 0 30px rgba(245,176,48,0.55), inset 0 0 18px rgba(245,176,48,0.18);
}

/* ─── Card content ────────────────────────────────────────────────────── */
.pfb-nxt-card-icon {
  font-size: 2.1rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}
.pfb-nxt-card-label {
  font-family: 'Anton', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--cream, #FFF3D0);
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.pfb-nxt-card-desc {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
  color: rgba(255,243,208,0.72);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Stacked (single-column) layout on tiny screens — more horizontal */
@media (max-width: 359px) {
  .pfb-nxt-card {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-height: 66px;
    padding: 12px 14px;
    gap: 12px;
  }
  .pfb-nxt-card-icon  { font-size: 1.8rem; }
  .pfb-nxt-card-label { font-size: 1.05rem; }
  .pfb-nxt-card-desc  { font-size: 0.65rem; }
  .pfb-nxt-card > div:not(.pfb-nxt-card-icon) {
    text-align: left;
  }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #pfb-nxt,
  .pfb-nxt-sheet,
  .pfb-nxt-card,
  .pfb-nxt-eyebrow,
  .pfb-nxt-headline {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
