﻿@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

:root {
  --pf-bg: #05060a;
  --pf-bg-panel: rgba(10, 12, 20, 0.96);
  --pf-bg-panel-soft: rgba(17, 24, 39, 0.96);
  --pf-border-soft: rgba(148, 163, 184, 0.45);
  --pf-accent: #facc15;
  --pf-accent-strong: #f97316;
  --pf-accent-soft: rgba(250, 204, 21, 0.25);
  --pf-text-main: #f9fafb;
  --pf-text-muted: #9ca3af;
  --pf-danger: #f97373;
  --pf-success: #4ade80;
  --pf-card-bg: rgba(15, 23, 42, 0.96);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img {
    pointer-events: none;
}

body.pf-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--pf-text-main);
  user-select: none;
  user-drag: none;
}

/* AUTH / LANDING */

body.pf-auth-body,
body.pf-legal-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--pf-text-main);
  background:
    radial-gradient(circle at 15% 10%, rgba(250,204,21,0.14), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(56,189,248,0.14), transparent 34%),
    radial-gradient(circle at 55% 110%, rgba(249,115,22,0.13), transparent 42%),
    var(--pf-bg);
}

.pf-auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(640px, 100vh) auto;
}

.pf-auth-hero {
  position: relative;
  min-height: 640px;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  overflow: hidden;
}

.pf-auth-sim {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 18px;
  align-items: center;
  padding: 28px;
  opacity: 0.58;
  transform: rotate(-7deg) scale(1.12);
  pointer-events: none;
}

.pf-auth-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px;
  aspect-ratio: 7 / 12;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(2,6,23,0.62);
  box-shadow: 0 28px 80px rgba(0,0,0,0.48);
  animation: pf-auth-board-float 8s ease-in-out infinite;
}

.pf-auth-board--2,
.pf-auth-board--4 {
  transform: translateY(72px);
  animation-delay: -2.5s;
}

.pf-auth-board--3 {
  animation-delay: -4.5s;
}

.pf-auth-board span {
  border-radius: 5px;
  background: linear-gradient(145deg, hsla(var(--h), 86%, 64%, 0.95), hsla(var(--h), 84%, 42%, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), 0 7px 18px rgba(0,0,0,0.26);
  opacity: 0.74;
  animation: pf-auth-cell-pulse 2.8s ease-in-out infinite;
  animation-delay: calc(var(--d) * -0.16s);
}

@keyframes pf-auth-board-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

@keyframes pf-auth-cell-pulse {
  0%, 100% { filter: brightness(0.82); transform: scale(0.96); }
  50% { filter: brightness(1.22); transform: scale(1); }
}

.pf-auth-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.36);
  background:
    radial-gradient(circle at 0 0, rgba(250,204,21,0.12), transparent 48%),
    rgba(10,12,20,0.88);
  box-shadow: 0 34px 110px rgba(0,0,0,0.74);
  backdrop-filter: blur(14px);
}

.pf-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.pf-auth-brand h1 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-auth-brand p {
  margin: 5px 0 0;
  color: var(--pf-text-muted);
  font-size: 13px;
}

.pf-auth-actions {
  display: grid;
  gap: 10px;
}

.pf-auth-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.42);
  background: rgba(15,23,42,0.9);
  color: var(--pf-text-main);
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.pf-auth-provider:hover {
  transform: translateY(-1px);
  border-color: rgba(250,204,21,0.72);
  background: rgba(30,41,59,0.94);
}

.pf-auth-provider span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: #111827;
  font-weight: 900;
}

.pf-auth-provider--dev span {
  background: linear-gradient(135deg, #facc15, #f97316);
}

.pf-auth-provider--disabled {
  opacity: 0.46;
  cursor: default;
  pointer-events: none;
}

.pf-auth-note {
  margin: 16px 0 0;
  color: var(--pf-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.pf-auth-language {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  color: var(--pf-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-auth-language select,
.pf-language-select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.44);
  background: rgba(2,6,23,0.78);
  color: var(--pf-text-main);
  padding: 8px 10px;
  outline: none;
}

.pf-auth-language select:focus,
.pf-language-select:focus {
  border-color: rgba(250,204,21,0.78);
  box-shadow: 0 0 0 2px rgba(250,204,21,0.12);
}

.pf-auth-note a {
  color: #facc15;
}

.pf-auth-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(148,163,184,0.16);
  border-top: 1px solid rgba(148,163,184,0.18);
}

.pf-auth-info article {
  min-height: 150px;
  padding: 26px;
  display: grid;
  align-content: center;
  gap: 6px;
  background: rgba(5,6,10,0.92);
}

.pf-auth-info strong {
  font-family: "Oswald", sans-serif;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pf-auth-info span {
  color: var(--pf-text-muted);
  line-height: 1.45;
}

/* LEGAL */

.pf-legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.pf-legal-page h1 {
  margin: 0 0 24px;
  font-family: "Oswald", sans-serif;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pf-legal-page section {
  margin: 0 0 14px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.26);
  background: rgba(15,23,42,0.78);
}

.pf-legal-page h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.pf-legal-page p {
  margin: 0;
  color: var(--pf-text-muted);
  line-height: 1.55;
}

.pf-legal-page a {
  color: #facc15;
}

@media (max-width: 820px) {
  .pf-auth-page {
    grid-template-rows: minmax(560px, auto) auto;
  }

  .pf-auth-hero {
    min-height: 560px;
    padding: 22px 14px;
  }

  .pf-auth-sim {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 12px;
    padding: 14px;
    opacity: 0.38;
  }

  .pf-auth-panel {
    padding: 18px;
    border-radius: 14px;
  }

  .pf-auth-brand h1,
  .pf-legal-page h1 {
    font-size: 34px;
  }

  .pf-auth-info {
    grid-template-columns: 1fr;
  }
}
body.pf-body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -2; /* plus bas que les cubes */
  background:
    radial-gradient(circle at 0% 0%, rgba(255,255,255,0.03), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(250,204,21,0.07), transparent 60%),
    radial-gradient(circle at 50% 120%, rgba(56,189,248,0.08), transparent 65%),
    radial-gradient(circle at -20% 80%, rgba(244,63,94,0.06), transparent 60%),
    var(--pf-bg);
  animation:
    pf-bg-rotate 5s linear infinite,
    pf-bg-move 8s ease-in-out infinite alternate;
  filter: hue-rotate(0deg);

  /* Même look que ton fond d'origine */
  background:
    radial-gradient(circle at 0% 0%, rgba(255,255,255,0.03), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(250,204,21,0.07), transparent 60%),
    radial-gradient(circle at 50% 120%, rgba(56,189,248,0.08), transparent 65%),
    radial-gradient(circle at -20% 80%, rgba(244,63,94,0.06), transparent 60%),
    var(--pf-bg);

  /* Animations : rotation de teinte + léger mouvement */
  animation:
    pf-bg-rotate 10s linear infinite,
    pf-bg-move 8s ease-in-out infinite alternate;
  filter: hue-rotate(0deg);
}

/* Animation hue-rotate (change légèrement les couleurs) */
@keyframes pf-bg-rotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* Animation du déplacement des radiales */
@keyframes pf-bg-move {
  0% {
    --p1x: 0%;
    --p1y: 0%;
    --p2x: 100%;
    --p2y: 100%;
    --p3x: 50%;
    --p3y: 120%;
    --p4x: -20%;
    --p4y: 80%;
  }
  100% {
    --p1x: -10%;
    --p1y: 10%;
    --p2x: 110%;
    --p2y: 90%;
    --p3x: 45%;
    --p3y: 110%;
    --p4x: -10%;
    --p4y: 70%;
  }
}


/* Conteneur global pour la pluie de cubes */
#pf_cube_rain {
  position: fixed;
  inset: 0;
  z-index: -1;         /* au-dessus du fond ::before, en dessous de l'UI */
  pointer-events: none;
  overflow: hidden;
}

/* Cube générique */
.pf-cube {
  position: absolute;
  top: -20vmin;
  width: var(--pf-cube-size, 80px);
  height: var(--pf-cube-size, 80px);
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(47, 91, 120, 1.);
  background:
    linear-gradient(145deg, rgba(15,23,42,0.95), rgba(18, 39, 104, .9019607843137255)),
    radial-gradient(circle at 10% 0%, rgba(250,204,21,0.35), transparent 60%);
  box-shadow:
    0 0 25px rgba(15,23,42,0.8),
    0 0 45px rgba(15,23,42,0.9);

  opacity: var(--pf-cube-opacity, 0.22);
  filter: blur(var(--pf-cube-blur, 0px));
  transform: translate3d(0, 0, 0)
             rotate3d(var(--pf-cube-rx, 1), var(--pf-cube-ry, 1), 0, var(--pf-cube-rstart, 0deg));

  animation: pf-bg-rotate 20s linear infinite, pf-cube-fall var(--pf-cube-duration, 25s) linear infinite;
  animation-delay: var(--pf-cube-delay, 0s);
}

/* Plans de profondeur */
.pf-cube-near {
  --pf-cube-opacity: 0.26;
  --pf-cube-blur: 0px;
}

.pf-cube-mid {
  --pf-cube-opacity: 0.2;
  --pf-cube-blur: 1px;
}

.pf-cube-far {
  --pf-cube-opacity: 0.12;
  --pf-cube-blur: 2px;
}

/* Animation de chute */
@keyframes pf-cube-fall {
  0% {
    transform: translate3d(0, -120vh, 0)
               rotate3d(var(--pf-cube-rx, 1), var(--pf-cube-ry, 1), 0, var(--pf-cube-rstart, 0deg));
  }
  100% {
    transform: translate3d(0, 120vh, 0)
               rotate3d(var(--pf-cube-rx, 1), var(--pf-cube-ry, 1), 0, var(--pf-cube-rend, 360deg));
  }
}





.pf-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.pf-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;          /* Très important pour recadrer l'image */
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  display: block;             /* Évite les espaces inline */
  background-color: #1f2937;  /* Fond si l'image charge lentement */
}

.pf-avatar-img-large {
  width: 96px;
  height: 96px;
  border-radius: 4px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.20);
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  display: block;
  background-color: #1f2937;
}


/* START OVERLAY */

.pf-start-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(255,255,255,0.05), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(250,204,21,0.10), transparent 60%),
    rgba(3,7,18,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.pf-start-box {
    width: 100%;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.pf-start-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-start {
  font-size: 15px;
  color: var(--pf-text-main);
}

.pf-start-subtitle {
  font-size: 13px;
  color: var(--pf-text-muted);
}

.pf-start-hint {
  font-size: 11px;
  color: var(--pf-text-muted);
  margin-top: 4px;
}

/* HEADER */

.pf-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
/*  background: linear-gradient(to right, rgba(15,23,42,0.98), rgba(3,7,18,0.98));
  border-bottom: 1px solid rgba(31,41,55,0.9);
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);*/
}

.pf-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pf-header-right {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.34);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(15,23,42,0.96), rgba(30,41,59,0.92)),
    rgba(15,23,42,0.95);
  box-shadow: 0 10px 30px rgba(0,0,0,0.34);
}

.pf-header-tab {
  position: relative;
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 6px;
  background: rgba(15,23,42,0.72);
  color: var(--pf-text-muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pf-header-tab:hover {
  border-color: var(--pf-accent);
  color: var(--pf-text-main);
}

.pf-header-icon-btn {
  position: relative;
  width: 46px;
  min-height: 50px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-right: 1px solid rgba(148,163,184,0.18);
  border-radius: 0;
  background: transparent;
  color: var(--pf-text-main);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.pf-header-icon-btn:hover {
  transform: none;
  color: #facc15;
  background: rgba(250,204,21,0.08);
}

.pf-header-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.pf-header-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.pf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: radial-gradient(circle at 30% 20%, #fff, #facc15);
  color: #111827;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.pf-logo-text {
  display: flex;
  flex-direction: column;
}

.pf-logo-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-logo-subtitle {
  font-size: 11px;
  color: var(--pf-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pf-online-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pf-accent);
  font-weight: 700;
}

.pf-online-count::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 6px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.8);
}

/* NAV */

.pf-nav {
  display: flex;
  gap: 8px;
}

.pf-nav-item {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.08s ease;
}

.pf-nav-item:hover {
  background: rgba(31,41,55,0.9);
  color: var(--pf-text-main);
}

.pf-nav-item--active {
  background: radial-gradient(circle at 0 0, rgba(255,255,255,0.12), transparent 60%),
              linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
}

/* PLAYER SUMMARY */

.pf-player-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px 14px 6px 10px;
  border-radius: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pf-header-mmr-card,
.pf-header-currency-card {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(148,163,184,0.18);
  background:
    linear-gradient(135deg, rgba(250,204,21,0.16), rgba(249,115,22,0.10));
}

.pf-header-currency-card {
  background:
    linear-gradient(135deg, rgba(34,197,94,0.14), rgba(59,130,246,0.08));
}

.pf-header-rank-icon,
.pf-header-currency-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(250,204,21,0.65);
  background: rgba(250,204,21,0.16);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
}

.pf-header-currency-icon {
  border-color: rgba(34,197,94,0.65);
  background: rgba(34,197,94,0.15);
  color: #bbf7d0;
}

.pf-header-mmr-text,
.pf-header-currency-text {
  color: #fef3c7;
  font-size: 12px;
  font-weight: 900;
}

.pf-header-currency-text {
  color: #dcfce7;
}

.pf-player-summary:hover,
.pf-header-mmr-card:hover,
.pf-header-currency-card:hover {
  background-color: rgba(255,255,255,0.035);
}

.pf-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: radial-gradient(circle at 30% 20%, #fff, #22c55e);
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-avatar-circle--big {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.pf-player-text {
  display: flex;
  flex-direction: column;
  padding: 0 0 0 14px;
  min-width: 0;
}

.pf-player-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-player-title {
  width: fit-content;
  max-width: 150px;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.09);
  color: #fde68a;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-player-mmr {
  font-size: 11px;
  color: var(--pf-text-muted);
}

/* MAIN & SCREENS */

.pf-main {
  flex: 1;
  padding: 18px 20px 24px;
  display: flex;
}

.pf-screen {
  display: none;
  width: 100%;
}

.pf-screen--active {
  display: block;
}

.pf-screen--game {
  display: none;
}

.pf-screen-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

#screen_play_root .pf-screen-inner,
#screen_play_solo .pf-screen-inner,
#screen_play_casual .pf-screen-inner,
#screen_play_ranked .pf-screen-inner,
#screen_play_friends .pf-screen-inner,
#screen_play_spectate .pf-screen-inner,
#screen_challenges .pf-screen-inner
{
    height: calc(100% - clamp(36px, 6vw, 72px));
    display: flex;
    flex-direction: column;
}

.pf-card-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-around;
}

.pf-screen-title {
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
	font-family: "Oswald", sans-serif;
  margin: 0 0 4px;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 0.95;
}

.pf-screen-subtitle {
  font-size: 13px;
  color: var(--pf-text-muted);
  margin: 0 0 14px;
}

.pf-screen-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.pf-link-button {
  border: 2px solid var(--pf-text-muted);
  background: none;
  border-radius: 6px;
  padding: 8px;
  color: var(--pf-text-muted);
  font-size: 20px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.2s;
}

.pf-link-button:hover {
  border: 2px solid white;
  background: none;
  color: white;
}

.pf-link-button .btn-echap {
  border: 1px solid var(--pf-text-muted);
  font-size: 12px;
  padding: 4px 6px;
  margin: 0 8px 0 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: inline-block;
  vertical-align: bottom;
  border-radius: 2px;
}

@media (max-width: 760px) {
  .pf-main {
    padding: 12px;
    min-width: 0;
    overflow-x: hidden;
  }

  .pf-screen {
    min-width: 0;
    overflow-x: hidden;
  }

  .pf-screen-header-row {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 8px;
  }

  .pf-player-text { display: none; }

  .pf-header {
    padding: 0 10px;
  }

  .pf-header-right {
    gap: 0;
  }

  .pf-header-mmr-card,
  .pf-header-currency-card {
    min-height: 40px;
    padding: 6px 9px;
    gap: 6px;
    flex-shrink: 0;
  }

  .pf-header-mmr-text,
  .pf-player-currency {
    display: none;
  }

  .pf-header-currency-icon {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .pf-header-currency-text {
    display: inline-block;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1;
  }

  .pf-header-icon-btn {
    width: 38px;
    min-height: 40px;
  }

  .pf-header-tab {
    padding: 6px 8px;
    font-size: 11px;
  }

  .pf-screen-header-row .pf-link-button {
    order: -1;
  }

  .pf-screen-title {
    font-size: clamp(30px, 12vw, 46px);
    letter-spacing: 0.02em;
    line-height: 0.98;
    width: 100%;
    white-space: normal;
  }

  .pf-link-button {
    max-width: 100%;
    padding: 6px 8px;
    font-size: 14px;
  }

  .pf-link-button .btn-echap {
    font-size: 10px;
    padding: 3px 5px;
    margin-right: 6px;
  }
}

@media (max-width: 380px) {
  .pf-screen-title {
    font-size: clamp(25px, 11vw, 34px);
    letter-spacing: 0.01em;
  }
}

/* CARDS */


.pf-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
  justify-content: center;
}

#screen_play_root .pf-card-grid, #screen_play_casual .pf-card-grid, #screen_play_ranked .pf-card-grid, #screen_play_solo .pf-card-grid {
  grid-template-columns: repeat(auto-fit, 262px);
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
#screen_play_root .pf-card, #screen_play_casual .pf-card, #screen_play_ranked .pf-card {
  min-height: 355px;
}

.pf-card-grid--large {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

#screen_options_root .pf-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  #screen_options_root .pf-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #screen_options_root .pf-card-grid {
    grid-template-columns: 1fr;
  }
}

.pf-card {
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--pf-border-soft);
    background: var(--pf-card-bg);
    box-shadow: 0 14px 40px rgba(0,0,0,0.75),
    0 0 0 1px rgba(15,23,42,0.98);
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    transition: transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
    flex-direction: column;
}

.pf-card-main {
  min-height: 120px;
}

.pf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(250,204,21,0.7);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.85),
    0 0 0 1px rgba(15,23,42,1);
    z-index: 2;
}

.pf-card--mode {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pf-event-block {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  margin: 24px auto 0;
}

.pf-event-block-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px;
}

.pf-event-block-head h2 {
  margin: 4px 0 0;
  font-size: 1.8rem;
}

.pf-event-block-kicker,
.pf-event-block-note {
  color: var(--pf-text-muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pf-event-block-note {
  max-width: 340px;
  text-align: right;
  line-height: 1.35;
  text-transform: none;
}

.pf-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(980px, 100%);
}

.pf-event-card {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 22px;
  border: 2px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(40, 210, 255, 0.14), rgba(255, 211, 88, 0.10)),
    rgba(12, 18, 32, 0.92);
  box-shadow: 0 20px 0 rgba(0,0,0,0.18);
}

.pf-event-kicker,
.pf-event-meta {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--pf-text-muted);
}

.pf-event-card h2 {
  margin: 0;
  font-size: 1.55rem;
}

.pf-event-card p {
  margin: 0;
  color: var(--pf-text-muted);
  line-height: 1.45;
}

.pf-event-card .pf-btn {
  align-self: end;
  width: 100%;
}

.pf-event-card.is-played {
  opacity: 0.72;
}

.pf-event-card.is-empty {
  opacity: 0.62;
}

.pf-event-leaderboards {
  width: min(1180px, 100%);
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pf-event-leaderboard {
  min-width: 0;
  padding: 18px;
  border: 2px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(12, 18, 32, 0.88);
}

.pf-event-leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pf-event-leaderboard-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pf-event-leaderboard-head span {
  color: var(--pf-text-muted);
  font-weight: 800;
  text-transform: uppercase;
}

.pf-event-leaderboard-rows {
  display: grid;
  gap: 8px;
}

.pf-event-leaderboard-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
}

.pf-event-leaderboard-row[data-profile-user] {
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.pf-event-leaderboard-row[data-profile-user]:hover,
.pf-event-leaderboard-row[data-profile-user]:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255,255,255,0.1);
}

.pf-event-leaderboard-player {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.pf-event-leaderboard-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--pf-text);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pf-event-leaderboard-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pf-event-leaderboard-player b,
.pf-event-leaderboard-row span {
  min-width: 0;
}

.pf-event-leaderboard-player b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .pf-event-block-head {
    display: grid;
    align-items: start;
  }

  .pf-event-block-note {
    max-width: none;
    text-align: left;
  }

  .pf-event-grid {
    grid-template-columns: 1fr;
  }

  .pf-event-leaderboards {
    grid-template-columns: 1fr;
  }

  .pf-event-card {
    min-height: 0;
    padding: 18px;
  }

  .pf-event-leaderboard-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .pf-event-leaderboard-row span:last-child {
    display: none;
  }
}

.pf-card--disabled {
  opacity: 0.6;
  cursor: default;
}

.pf-card-static {
  cursor: default;
}

.pf-card-static:hover {
  transform: none;
}

.pf-card-toggle {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
}

.pf-card-toggle:hover {
  transform: translateY(-2px);
}

.pf-card-toggle > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pf-card-toggle input[type="checkbox"] {
  align-self: center;
  justify-self: center;
  width: 28px;
  height: 28px;
  margin: 18px;
  accent-color: var(--pf-accent);
}

.pf-card-toggle .pf-card-title,
.pf-card-toggle .pf-card-desc {
  text-align: left;
  justify-content: flex-start;
}

.pf-card-toggle .pf-card-title {
  padding-left: 25px;
  padding-right: 10px;
}

.pf-mobile-option-only {
  display: none;
}

.pf-native-mobile-app .pf-mobile-option-only {
  display: grid;
}

.pf-card-title {
    font-size: 18px;
    font-weight: 600;
    padding: 14px 0;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
}

.pf-card-title--with-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pf-menu-gold-dot {
    display: inline-grid;
    place-items: center;
    padding: 4px 7px;
    border-radius: 6px;
    margin-left: 12px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    font-style: normal;
    background:
      radial-gradient(circle at 32% 28%, #fff7ad 0 18%, #fde047 36%, #f59e0b 72%, #b45309 100%);
    box-shadow:
      0 0 0 1px rgba(255, 247, 173, 0.7),
      0 0 18px rgba(250, 204, 21, 0.7);
    text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000;
    color: #fff;
}

.pf-menu-gold-dot.hidden {
    display: none !important;
}

#screen_options_root .pf-card-title {
    color: #f97316;
}

.pf-card-desc {
  color: var(--pf-text-muted);
  padding: 16px 25px;
  text-align: center;
  font-size: 12px;
  background: var(--pf-card-bg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-card-desc--stack {
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.pf-card-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pf-card-tag--green {
  border-color: rgba(34,197,94,0.7);
  color: #bbf7d0;
}

.pf-card-tag--orange {
  border-color: rgba(249,115,22,0.8);
  color: #fed7aa;
}

.pf-card-tag--blue {
  border-color: rgba(59,130,246,0.8);
  color: #bfdbfe;
}

.pf-card-tag--yellow {
  border-color: rgba(226, 182, 8,0.8);
  color: #bfdbfe;
}

.pf-card-tag--purple {
  border-color: rgba(168,85,247,0.8);
  color: #e9d5ff;
}

.pf-card--green {
  background-color: rgba(34,197,94,1);
  color: #fff;
}
.pf-card--green-dark {
  background-color: #119943;
  color: #fff;
}

.pf-card--orange {
  background-color: rgba(249,115,22,1);
  color: #fff;
}

.pf-card--blue {
  background-color: rgba(59,130,246,1);
  color: #fff;
}

.pf-card--yellow {
  background-color: rgba(226, 182, 8, 1);
  color: #fff;
}

.pf-card--purple {
  background-color: rgba(168,85,247,1);
  color: #fff;
}

.pf-card--pink {
  background-color: rgba(219,39,119,1);
  color: #fff;
}

.pf-card-danger {
  border-color: rgba(248,113,113,0.62);
  background:
    radial-gradient(circle at 100% 0, rgba(248,113,113,0.18), transparent 42%),
    rgba(127,29,29,0.42);
  color: #fee2e2;
}

.pf-card-danger:hover {
  border-color: rgba(248,113,113,0.92);
  box-shadow: 0 20px 60px rgba(127,29,29,0.38), 0 0 0 1px rgba(248,113,113,0.18);
}

/* BOUTONS GÉNÉRIQUES */

.pf-btn {
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.7);
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg,#1f2937,#020617);
  color: var(--pf-text-main);
  transition:
    background 0.12s ease,
    transform 0.08s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.pf-btn-primary {
  border-color: rgba(250,204,21,0.9);
  background: linear-gradient(135deg,#facc15,#f97316);
  color: #111827;
  box-shadow: 0 14px 35px rgba(234,179,8,0.4);
}

.pf-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.pf-btn-secondary {
  background: linear-gradient(135deg,#111827,#020617);
}

.pf-btn-danger {
  border-color: rgba(248,113,113,0.9);
  background: linear-gradient(135deg,#ef4444,#991b1b);
  color: #fff;
  box-shadow: 0 14px 35px rgba(127,29,29,0.36);
}

.pf-btn-danger:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.pf-btn-ghost {
  background: transparent;
  border-color: rgba(148,163,184,0.5);
}

.pf-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.pf-gamepad-focused {
  outline: 3px solid #facc15 !important;
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px rgba(2,6,23,0.9),
    0 0 22px rgba(250,204,21,0.45) !important;
}

/* PLACEHOLDERS */

.pf-placeholder-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15,23,42,0.95);
  border: 1px dashed rgba(148,163,184,0.7);
  font-size: 13px;
  color: var(--pf-text-muted);
}

.pf-placeholder-box--small {
  font-size: 12px;
}

/* ENTRE AMIS */

.pf-friends-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.pf-friends-panel,
.pf-friends-room {
  border: 1px solid rgba(148,163,184,0.45);
  border-radius: 8px;
  background: rgba(15,23,42,0.92);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  padding: 16px;
}

.pf-friends-panel {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.pf-friends-panel-title {
  font-family: "Oswald", sans-serif;
  font-size: 24px;
  text-transform: uppercase;
}

.pf-friends-panel-text,
.pf-friends-hint,
.pf-friends-status,
.pf-friends-label {
  color: var(--pf-text-muted);
  font-size: 13px;
}

.pf-friends-label {
  display: block;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.pf-friends-join-row {
  display: flex;
  gap: 8px;
}

.pf-friends-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(148,163,184,0.65);
  border-radius: 6px;
  background: rgba(2,6,23,0.82);
  color: var(--pf-text-main);
  padding: 9px 12px;
  font-size: 14px;
  text-transform: uppercase;
  outline: none;
}

.pf-friends-input:focus {
  border-color: rgba(250,204,21,0.95);
  box-shadow: 0 0 0 3px rgba(250,204,21,0.12);
}

.pf-friends-room {
  margin-top: 14px;
}

.pf-friends-room-head,
.pf-friends-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pf-friends-room-code {
  color: var(--pf-text-muted);
  font-size: 13px;
}

.pf-friends-room-code span {
  color: var(--pf-accent);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.pf-friends-copy {
  margin-left: 10px;
  border: 1px solid rgba(148,163,184,0.55);
  border-radius: 6px;
  background: rgba(2,6,23,0.72);
  color: var(--pf-text-main);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 9px;
}

.pf-friends-copy:hover {
  border-color: rgba(250,204,21,0.9);
}

.pf-friends-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.pf-friends-player {
  border: 1px solid rgba(55,65,81,0.9);
  border-radius: 8px;
  background: rgba(2,6,23,0.56);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-friends-player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.45);
}

.pf-friends-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-friends-player-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pf-accent);
  font-size: 13px;
  font-weight: 800;
}

.pf-friends-player-body {
  min-width: 0;
}

.pf-friends-player-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-friends-player-role {
  color: var(--pf-text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.pf-friends-player-ready {
  color: var(--pf-danger);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
}

.pf-friends-player-ready--ok {
  color: var(--pf-success);
}

.pf-friends-status {
  margin-top: 10px;
}

.pf-friends-status--error {
  color: var(--pf-danger);
}

.pf-friends-status--ok {
  color: var(--pf-success);
}

/* SPECTATEUR */

.pf-spectate-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.pf-replay-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(250,204,21,0.28);
  background:
    radial-gradient(circle at 100% 0, rgba(250,204,21,0.09), transparent 45%),
    rgba(17,24,39,0.94);
}

.pf-replay-code-title {
  color: var(--pf-text-main);
  font-weight: 900;
}

.pf-replay-code-text {
  margin-top: 3px;
  color: var(--pf-text-muted);
  font-size: 13px;
}

.pf-replay-code-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pf-replay-code-actions input {
  width: 140px;
  text-transform: uppercase;
}

.pf-spectate-filter {
  border: 1px solid rgba(148,163,184,0.55);
  border-radius: 6px;
  background: rgba(2,6,23,0.72);
  color: var(--pf-text-main);
  cursor: pointer;
  font-size: 13px;
  padding: 7px 12px;
}

.pf-spectate-filter--active {
  border-color: rgba(250,204,21,0.95);
  color: var(--pf-accent);
}

.pf-spectate-status {
  color: var(--pf-text-muted);
  font-size: 13px;
  margin: 10px 0;
}

.pf-spectate-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pf-spectate-row {
  border: 1px solid rgba(55,65,81,0.9);
  border-radius: 8px;
  background: rgba(15,23,42,0.92);
  color: var(--pf-text-main);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.pf-spectate-row:hover {
  border-color: rgba(250,204,21,0.8);
}

.pf-spectate-mode {
  color: var(--pf-accent);
  font-weight: 800;
  text-transform: uppercase;
}

.pf-spectate-players,
.pf-spectate-meta {
  color: var(--pf-text-muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-spectate-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* RÈGLES */

.pf-rules-layout,
.pf-credits-layout {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.pf-rules-hero,
.pf-credits-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(250,204,21,0.28);
  border-radius: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(250,204,21,0.16), rgba(15,23,42,0.94) 42%),
    rgba(15,23,42,0.96);
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.pf-rules-hero h2,
.pf-credits-hero h2,
.pf-rules-section-head h2 {
  margin: 4px 0 8px;
  color: #fff7ed;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.pf-rules-hero p,
.pf-credits-hero p,
.pf-rules-card p,
.pf-explosion-card p,
.pf-credits-card p {
  margin: 0;
  color: var(--pf-text-muted);
  line-height: 1.55;
}

.pf-rules-kicker {
  display: inline-flex;
  width: fit-content;
  color: var(--pf-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-rules-mini-board,
.pf-rule-example {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-rules-mini-board {
  justify-content: center;
  min-width: 220px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(2,6,23,0.54);
  border: 1px solid rgba(255,255,255,0.08);
}

.pf-rule-cube {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 1000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 10px 20px rgba(0,0,0,0.28);
}

.pf-rule-cube--blue { background: linear-gradient(145deg, #38bdf8, #2563eb); }
.pf-rule-cube--red { background: linear-gradient(145deg, #fb7185, #dc2626); }
.pf-rule-cube--active {
  position: relative;
  outline: 2px solid rgba(250,204,21,0.95);
}

.pf-rule-cube--active::before,
.pf-rule-cube--active::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 3px solid rgba(250,204,21,0.95);
  border-right: 3px solid rgba(250,204,21,0.95);
  filter: drop-shadow(0 0 6px rgba(250,204,21,0.8));
}

.pf-rule-cube--active::before {
  left: -8px;
  transform: translateY(-50%) rotate(-135deg);
}

.pf-rule-cube--active::after {
  right: -8px;
  transform: translateY(-50%) rotate(45deg);
}
.pf-rule-arrow { color: var(--pf-accent); font-size: 28px; font-weight: 1000; }
.pf-rule-hint { color: var(--pf-text-muted); font-size: 12px; line-height: 1.3; }

.pf-rules-grid,
.pf-credits-grid,
.pf-garbage-rules,
.pf-explosion-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.pf-rules-card,
.pf-rules-section,
.pf-credits-card {
  border-radius: 14px;
  padding: 16px;
  background: rgba(17,24,39,0.96);
  border: 1px solid rgba(55,65,81,0.9);
  font-size: 13px;
}

.pf-rules-card {
  display: grid;
  gap: 10px;
}

.pf-rules-card h2,
.pf-credits-card h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
}

.pf-rules-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pf-rules-list li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.pf-rules-list strong {
  color: var(--pf-accent);
}

.pf-rules-section {
  display: grid;
  gap: 14px;
}

.pf-rules-section-head h2 {
  font-size: 22px;
}

.pf-garbage-rule,
.pf-explosion-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  background: rgba(2,6,23,0.42);
}

.pf-garbage-rule h3,
.pf-explosion-card h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 15px;
}

.pf-garbage-rule small {
  display: block;
  margin-top: 10px;
  color: var(--pf-text-muted);
}

.pf-garbage-rule--red { border-color: rgba(248,113,113,0.42); }
.pf-garbage-rule--blue { border-color: rgba(96,165,250,0.42); }
.pf-garbage-rule--green { border-color: rgba(74,222,128,0.42); }
.pf-garbage-rule--yellow { border-color: rgba(250,204,21,0.42); }

.pf-explosion-card--red {
  border-color: rgba(248,113,113,0.42);
  background: radial-gradient(circle at 0 0, rgba(248,113,113,0.12), transparent 48%), rgba(2,6,23,0.42);
}

.pf-explosion-card--blue {
  border-color: rgba(96,165,250,0.42);
  background: radial-gradient(circle at 0 0, rgba(96,165,250,0.12), transparent 48%), rgba(2,6,23,0.42);
}

.pf-explosion-card--green {
  border-color: rgba(74,222,128,0.42);
  background: radial-gradient(circle at 0 0, rgba(74,222,128,0.12), transparent 48%), rgba(2,6,23,0.42);
}

.pf-explosion-card--yellow {
  border-color: rgba(250,204,21,0.42);
  background: radial-gradient(circle at 0 0, rgba(250,204,21,0.12), transparent 48%), rgba(2,6,23,0.42);
}

.pf-explosion-sim,
.pf-garbage-sim {
  width: min(100%, 286px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 0 auto 12px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.22);
}

.pf-explosion-sim span,
.pf-garbage-sim span {
  min-width: 0;
  border-radius: 5px;
  background: rgba(71,85,105,0.62);
}

.pf-garbage-sim span {
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 11px;
  font-weight: 1000;
}

.pf-garbage-sim .pf-garbage-cell--active {
  color: #0f172a;
  background: #cbd5e1;
  box-shadow: 0 0 16px rgba(203,213,225,0.52), inset 0 1px 0 rgba(255,255,255,0.55);
}

.pf-explosion-sim span:nth-child(25) {
  outline: 2px solid rgba(255,255,255,0.85);
  outline-offset: -2px;
}

.pf-explosion-sim--red span:nth-child(n+22):nth-child(-n+28),
.pf-explosion-sim--blue span:nth-child(7n+4),
.pf-explosion-sim--green span:nth-child(n+17):nth-child(-n+19),
.pf-explosion-sim--green span:nth-child(n+24):nth-child(-n+26),
.pf-explosion-sim--green span:nth-child(n+31):nth-child(-n+33),
.pf-explosion-sim--yellow span:nth-child(n+23):nth-child(-n+27),
.pf-explosion-sim--yellow span:nth-child(7n+4):nth-child(n+11):nth-child(-n+39) {
  box-shadow: 0 0 18px currentColor;
}

.pf-explosion-sim--red span:nth-child(n+22):nth-child(-n+28) { color: #fb7185; background: #ef4444; }
.pf-explosion-sim--blue span:nth-child(7n+4) { color: #38bdf8; background: #2563eb; }
.pf-explosion-sim--green span:nth-child(n+17):nth-child(-n+19),
.pf-explosion-sim--green span:nth-child(n+24):nth-child(-n+26),
.pf-explosion-sim--green span:nth-child(n+31):nth-child(-n+33) { color: #4ade80; background: #16a34a; }
.pf-explosion-sim--yellow span:nth-child(n+23):nth-child(-n+27),
.pf-explosion-sim--yellow span:nth-child(7n+4):nth-child(n+11):nth-child(-n+39) { color: #fde047; background: #facc15; }

.pf-credits-hero {
  grid-template-columns: 1fr;
}

.pf-credits-card {
  min-height: 130px;
}

@media (max-width: 760px) {
  .pf-rules-hero,
  .pf-credits-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .pf-rules-mini-board {
    min-width: 0;
    width: 100%;
  }

  .pf-rule-example {
    flex-wrap: wrap;
  }

  .pf-rules-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pf-explosion-sim,
  .pf-garbage-sim {
    width: min(100%, 150px);
  }
}

/* PROFIL */

.pf-profile-layout {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(0,1.1fr);
  gap: 16px;
  margin-top: 12px;
}

.pf-profile-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

@media (max-width: 900px) {
  .pf-profile-layout {
    grid-template-columns: 1fr;
  }

  .pf-contact-layout {
    grid-template-columns: 1fr;
  }

  .pf-contact-card-head {
    width: 100%;
    flex-wrap: wrap;
  }

  .pf-contact-card-head .pf-btn {
    flex: 1 1 180px;
  }

  .pf-contact-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .pf-replay-code-card,
  .pf-replay-code-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .pf-replay-code-actions input {
    width: 100%;
  }

  .pf-spectate-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px;
  }

  .pf-spectate-players,
  .pf-spectate-meta {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pf-contact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .pf-profile-header-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pf-profile-rank-card {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }
}

.pf-profile-header-card,
.pf-profile-stats-card,
.pf-profile-side-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(17,24,39,0.96);
  border: 1px solid rgba(55,65,81,0.9);
}

.pf-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pf-profile-header-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(116px, 142px);
  align-items: stretch;
  gap: 12px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 15% 0%, rgba(250,204,21,0.18), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(56,189,248,0.14), transparent 30%),
    rgba(17,24,39,0.96);
}

.pf-profile-header-card::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,0.08), transparent 65%);
  animation: pfProfileXpShine 3s linear infinite;
  pointer-events: none;
}

.pf-profile-name {
  font-size: 18px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-profile-username {
  color: var(--pf-text-muted);
  font-size: 12px;
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-profile-avatar-stack {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.pf-profile-header-text {
  position: relative;
  flex: 1;
  min-width: 0;
  z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.pf-profile-subitle,
.pf-profile-season {
  font-size: 12px;
  color: var(--pf-text-muted);
}

.pf-profile-xp-topline,
.pf-profile-level span {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-profile-level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-profile-level strong,
.pf-profile-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #111827;
  box-shadow: 0 10px 25px rgba(234,179,8,0.35);
}

.pf-profile-level-badge {
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
}

.pf-profile-rank-card {
  position: relative;
  z-index: 1;
  grid-column: 3;
  align-self: stretch;
  min-width: 0;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(250,204,21,0.32);
  background:
    linear-gradient(135deg, rgba(250,204,21,0.16), rgba(249,115,22,0.1)),
    rgba(2,6,23,0.36);
}

.pf-profile-rank-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(250,204,21,0.65);
  background: rgba(250,204,21,0.16);
  color: #fde68a;
  font-size: 12px;
  font-weight: 950;
}

.pf-profile-rank-mmr {
  color: #fef3c7;
  font-size: 16px;
  font-weight: 950;
}

.pf-profile-header-card .pf-profile-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .pf-profile-header-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pf-profile-rank-card {
    position: relative;
    top: auto;
    right: auto;
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .pf-profile-name,
  .pf-profile-header-card .pf-profile-title {
    max-width: 100%;
  }
}

.pf-profile-xp-inline {
  margin-top: 10px;
  width: 100%;
}

.pf-profile-xp-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.pf-profile-xp-bar {
  position: relative;
  height: 16px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(2,6,23,0.84);
  border: 1px solid rgba(148,163,184,0.18);
}

.pf-profile-xp-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(250,204,21,0.95), rgba(249,115,22,0.95)),
    linear-gradient(90deg, rgba(255,255,255,0.35), transparent);
  box-shadow: 0 0 22px rgba(250,204,21,0.34);
}

.pf-profile-xp-fill--anim {
  animation: pfProfileXpFill 1.1s cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes pfProfileXpFill {
  from { width: 0%; }
  to { width: var(--profile-xp-to, 0%); }
}

@keyframes pfProfileXpShine {
  from { transform: translateX(-50%) rotate(8deg); }
  to { transform: translateX(50%) rotate(8deg); }
}

.pf-profile-main {
  display: grid;
  gap: 12px;
}

.pf-profile-stats-card h2,
.pf-profile-side-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.pf-profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pf-profile-card-head h2 {
  margin: 0;
}

.pf-profile-season-select {
  border: 1px solid rgba(148,163,184,0.65);
  border-radius: 6px;
  background: rgba(2,6,23,0.82);
  color: var(--pf-text-main);
  font-size: 13px;
  padding: 7px 12px;
}

.pf-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.pf-profile-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.pf-profile-color-stat {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(55,65,81,0.9);
  border-radius: 8px;
  background: rgba(2,6,23,0.48);
  padding: 10px;
}

.pf-profile-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
}

.pf-profile-color-label {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-profile-color-stat strong {
  font-size: 18px;
}

.pf-profile-color-stat--blue .pf-profile-color-swatch { color: #38bdf8; background: #38bdf8; }
.pf-profile-color-stat--green .pf-profile-color-swatch { color: #34d399; background: #34d399; }
.pf-profile-color-stat--red .pf-profile-color-swatch { color: #fb7185; background: #fb7185; }
.pf-profile-color-stat--yellow .pf-profile-color-swatch { color: #facc15; background: #facc15; }
.pf-profile-color-stat--garbage .pf-profile-color-swatch { color: #94a3b8; background: #94a3b8; }

.pf-profile-stat {
  border: 1px solid rgba(55,65,81,0.9);
  border-radius: 8px;
  background: rgba(2,6,23,0.48);
  padding: 10px;
}

.pf-profile-stat span,
.pf-profile-mode-row span,
.pf-profile-history-meta,
.pf-profile-empty {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-profile-stat strong {
  display: block;
  font-size: 20px;
  margin-top: 3px;
}

.pf-profile-mode-list,
.pf-profile-history {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.pf-profile-history::-webkit-scrollbar {
  width: 8px;
}

.pf-profile-history::-webkit-scrollbar-track {
  background: rgba(2,6,23,0.45);
  border-radius: 6px;
}

.pf-profile-history::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.55);
  border-radius: 6px;
}

.pf-profile-mode-row,
.pf-profile-history-row {
  border: 1px solid rgba(55,65,81,0.9);
  border-radius: 8px;
  background: rgba(2,6,23,0.48);
  padding: 10px;
}

.pf-profile-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pf-profile-mode-row strong,
.pf-profile-mode-row span {
  display: block;
}

.pf-profile-mode-winrate {
  color: var(--pf-accent);
  font-weight: 800;
}

.pf-profile-history-top,
.pf-profile-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pf-profile-history-meta {
  margin-top: 6px;
  flex-wrap: wrap;
}

.pf-profile-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pf-profile-history-btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.pf-profile-history-result {
  font-weight: 800;
  text-transform: uppercase;
}

.pf-profile-history-result--win {
  color: var(--pf-success);
}

.pf-profile-history-result--lose {
  color: var(--pf-danger);
}

.pf-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.pf-contact-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(17,24,39,0.96);
  border: 1px solid rgba(55,65,81,0.9);
}

.pf-contact-card--full {
  width: 100%;
}

.pf-contact-card h2 {
  margin: 0;
  font-size: 16px;
}

.pf-contact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pf-contact-search input {
  width: 100%;
  border: 1px solid rgba(148,163,184,0.45);
  border-radius: 10px;
  background: rgba(2,6,23,0.72);
  color: var(--pf-text-main);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.pf-modal-box--contact {
  max-width: 720px;
}

.pf-contact-search-results {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.pf-contact-list {
  display: grid;
  gap: 8px;
}

#pf_contacts_friends {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  #pf_contacts_friends {
    grid-template-columns: 1fr;
  }
}

.pf-contact-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(55,65,81,0.75);
  background: rgba(2,6,23,0.45);
  cursor: pointer;
}

.pf-contact-row--online {
  border-color: rgba(34,197,94,0.72);
  background:
    linear-gradient(90deg, rgba(34,197,94,0.13), rgba(2,6,23,0.45) 42%),
    rgba(2,6,23,0.45);
  box-shadow: inset 3px 0 0 rgba(34,197,94,0.9);
}

.pf-contact-row--offline {
  opacity: 0.76;
}

.pf-contact-row:hover {
  border-color: rgba(250,204,21,0.7);
}

.pf-contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(15,23,42,0.9);
}

.pf-contact-main {
  display: grid;
  min-width: 0;
}

.pf-contact-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-contact-main span {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-contact-main .pf-contact-username {
  color: rgba(203,213,225,0.82);
  font-weight: 650;
}

.pf-contact-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.pf-contact-presence::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 6px;
  background: rgba(148,163,184,0.78);
  box-shadow: 0 0 0 2px rgba(148,163,184,0.10);
}

.pf-contact-presence--online {
  color: #86efac !important;
}

.pf-contact-presence--online::before {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,0.55);
}

.pf-contact-presence--offline {
  color: rgba(148,163,184,0.86) !important;
}

.pf-contact-presence--offline::before {
  background: rgba(100,116,139,0.86);
  box-shadow: 0 0 0 2px rgba(100,116,139,0.12);
}

.pf-challenges-layout {
  display: block;
  height: 100%;
  margin-top: 14px;
}

.pf-challenge-tabs,
.pf-challenge-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-challenge-tabs .pf-cos-filter-btn,
.pf-challenge-filterbar .pf-cos-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pf-challenge-tab-dot,
.pf-challenge-filter-dot {
  min-width: 17px;
  height: 17px;
  font-size: 9px;
  margin-left: 8px;
}

.pf-challenge-tabs {
  margin-bottom: 14px;
}

.pf-challenge-filterbar {
  margin: 0 0 12px;
}

.pf-challenge-filterbar:empty {
  display: none;
}

.pf-challenge-tab-panel.hidden {
  display: none !important;
}

.pf-challenge-limited-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pf-challenge-tab-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pf-challenge-panel {
  border-radius: 8px;
  padding: 14px;
  border: 1px solid rgba(55,65,81,0.95);
  background: rgba(15,23,42,0.94);
  height: 100%;
}

.pf-challenge-panel--daily { border-color: rgba(250,204,21,0.46); }
.pf-challenge-panel--weekly { border-color: rgba(59,130,246,0.46); }
.pf-challenge-panel--permanent { border-color: rgba(34,197,94,0.46); }

.pf-challenge-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;

    grid-auto-flow: column;
    align-items: center;
    justify-content: space-around;
}

.pf-challenge-timer {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.08);
  color: #fef3c7;
  font-size: 11px;
  font-weight: 800;
}

.pf-challenge-kicker {
  color: var(--pf-accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pf-challenge-permanent-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(250,204,21,0.28);
  background:
    radial-gradient(circle at 0 0, rgba(250,204,21,0.18), transparent 58%),
    rgba(2,6,23,0.34);
}

.pf-challenge-progress-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--pf-text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pf-challenge-progress-topline strong {
  color: #fde68a;
  white-space: nowrap;
}

.pf-challenge-permanent-bar {
  height: 13px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15,23,42,0.94);
  border: 1px solid rgba(148,163,184,0.18);
}

.pf-challenge-permanent-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #facc15, #f97316);
  box-shadow: 0 0 18px rgba(250,204,21,0.28);
  transition: width 0.3s ease;
}

.pf-challenge-list {
  display: grid;
  gap: 9px;
}

.pf-challenge-list--permanent {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  max-height: min(64vh, 680px);
  overflow-y: auto;
  padding-right: 5px;
}

.pf-challenge-list--permanent::-webkit-scrollbar {
  width: 8px;
}

.pf-challenge-list--permanent::-webkit-scrollbar-track {
  background: rgba(15,23,42,0.55);
  border-radius: 6px;
}

.pf-challenge-list--permanent::-webkit-scrollbar-thumb {
  background: rgba(250,204,21,0.48);
  border-radius: 6px;
}

.pf-challenge-list--permanent .pf-challenge-empty {
  grid-column: 1 / -1;
}

.pf-challenge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: rgba(2,6,23,0.45);
  border: 1px solid rgba(148,163,184,0.16);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.pf-challenge-row > * {
  position: relative;
  z-index: 1;
}

.pf-challenge-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pf-challenge-row span {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-challenge-desc {
  color: #fff!important;
  padding: 6px;
}

.pf-challenge-reward {
  color: #facc15 !important;
  font-weight: 900;
  white-space: nowrap;
}

.pf-challenge-reward--preview {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(250,204,21,0.42);
  border-radius: 8px;
  background: rgba(250,204,21,0.1);
  font: inherit;
  text-align: right;
  white-space: normal;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.pf-challenge-reward-type {
  color: #fde68a !important;
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.pf-challenge-reward-name {
  color: #facc15 !important;
  font-size: 12px !important;
  font-weight: 900;
  line-height: 1.15;
  padding: 5px 10px 0px 10px;
}

.pf-challenge-reward--preview:hover,
.pf-challenge-reward--preview:focus-visible {
  border-color: rgba(250,204,21,0.82);
  background: rgba(250,204,21,0.18);
  transform: translateY(-1px);
  outline: none;
}

.pf-modal-box--reward {
  max-width: 440px;
}

.pf-challenge-row--dynamic {
  align-items: stretch;
}

.pf-challenge-row--claimable {
  cursor: pointer;
  border-color: rgba(250,204,21,0.88);
  background:
    radial-gradient(circle at 0 0, rgba(255,247,173,0.24), transparent 52%),
    linear-gradient(135deg, rgba(250,204,21,0.28), rgba(249,115,22,0.18)),
    rgba(69,44,8,0.72);
  box-shadow:
    0 0 0 1px rgba(250,204,21,0.16) inset,
    0 0 18px rgba(250,204,21,0.16);
}

.pf-challenge-row--claimable:hover,
.pf-challenge-row--claimable:focus-visible {
  background:
    radial-gradient(circle at 0 0, rgba(255,247,173,0.34), transparent 54%),
    linear-gradient(135deg, rgba(250,204,21,0.34), rgba(249,115,22,0.24)),
    rgba(69,44,8,0.78);
  box-shadow:
    0 0 0 1px rgba(255,247,173,0.3) inset,
    inset 0 0 28px rgba(250,204,21,0.24);
}

.pf-challenge-row--claimable:focus-visible {
  outline: 2px solid rgba(250,204,21,0.86);
  outline-offset: 2px;
}

.pf-challenge-row--claimed {
  border-color: rgba(34,197,94,0.62);
  background:
    linear-gradient(135deg, rgba(34,197,94,0.18), rgba(20,83,45,0.18)),
    rgba(2,6,23,0.5);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.1) inset;
}

.pf-challenge-row--claimed-pop {
  animation: pfChallengeClaimedSettle 0.46s ease-out both;
}

.pf-challenge-row--claiming {
  pointer-events: none;
}

.pf-challenge-row--celebrate {
  animation: pfChallengeClaimPop 0.42s cubic-bezier(.18, 1.32, .35, 1) both;
}

.pf-challenge-row--celebrate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 34%, rgba(255,255,255,0.82) 0 3px, transparent 4px),
    radial-gradient(circle at 38% 22%, rgba(250,204,21,0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 62% 70%, rgba(255,247,173,0.82) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 38%, rgba(249,115,22,0.84) 0 4px, transparent 5px),
    radial-gradient(circle at 50% 50%, rgba(250,204,21,0.34), transparent 62%);
  opacity: 0;
  animation: pfChallengeSparkBurst 0.52s ease-out both;
}

@keyframes pfChallengeClaimPop {
  0% {
    filter: brightness(1);
  }
  38% {
    filter: brightness(1.22);
    box-shadow:
      0 0 0 1px rgba(255,247,173,0.42) inset,
      inset 0 0 34px rgba(250,204,21,0.32);
  }
  68% {
    filter: brightness(1.16);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes pfChallengeClaimedSettle {
  0% {
    filter: brightness(1.2);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes pfChallengeSparkBurst {
  0% {
    opacity: 0;
    transform: scale(0.92) rotate(0deg);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.05) rotate(6deg);
  }
}

.pf-challenge-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pf-challenge-progress {
  height: 7px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.18);
}

.pf-challenge-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #facc15, #f97316);
  transition: width 0.18s ease;
}

.pf-challenge-meta {
  color: rgba(226,232,240,0.76) !important;
  font-size: 11px !important;
}

.pf-challenge-category {
  justify-self: start;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.08);
  color: #fde68a !important;
  font-size: 10px !important;
  font-weight: 900;
  text-transform: uppercase;
}

.pf-challenge-side {
  display: grid;
  gap: 7px;
  justify-items: end;
  align-content: center;
}

.pf-challenge-empty {
  padding: 10px;
  border-radius: 7px;
  border: 1px dashed rgba(148,163,184,0.25);
  color: var(--pf-text-muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .pf-challenge-limited-grid,
  .pf-challenge-list--permanent {
    grid-template-columns: 1fr;
  }

  .pf-challenge-row {
    grid-template-columns: 1fr;
  }

  .pf-challenge-side {
    grid-template-columns: 1fr auto;
    justify-items: start;
    align-items: center;
  }

  .pf-challenge-reward--preview {
    text-align: left;
  }
}

.pf-contact-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pf-contact-action {
  padding: 7px 9px;
  font-size: 12px;
}

.pf-lb-table tr[data-profile-user] {
  cursor: pointer;
}

/* GAME SCREEN */

.pf-screen--game {
  display: none;
}

.pf-screen--game.pf-screen--active {
  display: block;
}

.pf-game-layout {
  width: min(100%, 1440px);
  margin: 0 auto;
  height: calc(100dvh - 74px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pf-game-topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
}

.pf-game-mode-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--pf-accent-soft);
  background: rgba(15,23,42,0.9);
}

.pf-game-status {
  font-size: 12px;
  color: var(--pf-text-muted);
  text-align: center;
}

.pf-game-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) minmax(180px, 260px);
  gap: 16px;
  align-items: center;
  min-height: 0;
}

#pf_canvas {
  display: block;
  width: auto;
  height: min(100%, calc(100dvh - 152px));
  max-width: 100%;
  aspect-ratio: 7 / 12;
  touch-action: none;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% -10%, rgba(148, 163, 184, 0.35), transparent 55%),
    #111827;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.8),
    inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.pf-game-board-zone {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
}

.pf-game-sidepanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.pf-game-nextbox, .pf-game-gincoming,
.pf-game-statsbox,
.pf-game-player-card,
.pf-game-opponent-panel {
  border-radius: 14px;
  padding: 10px;
  background: rgba(17,24,39,0.96);
  border: 1px solid rgba(55,65,81,0.9);
}

.pf-game-player-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 78px;
}

.pf-game-player-avatar {
  width: 58px;
  height: 58px;
  border-radius: 4px;
  display: block;
  object-fit: cover;
  border: 2px solid rgba(250,204,21,0.28);
  background: rgba(15,23,42,0.9);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.pf-game-player-identity {
  min-width: 0;
}
/* Base G INCOMING */
#pf_g_incoming_value,
.pf-game-gincoming-value {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--pf-text-muted);
  font-weight: 500;
  min-width: 36px;
  text-align: center;
  transition: all 0.18s ease-out;
}

/* Quand des G vont arriver */
#pf_g_incoming_value.pf-g-incoming-active,
.pf-game-gincoming-value.pf-g-incoming-active {
  border-color: var(--pf-accent);
  color: var(--pf-accent);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.08);
}

.pf-game-box-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pf-text-muted);
  margin-bottom: 6px;
}

#pf_next_canvas {
  width: 80px!important;
  height: 80px!important;
  display: block;
  margin: 0 auto;
}

.pf-game-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.pf-game-player-name {
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-game-player-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.1);
  color: #fde68a;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-game-player-meta.hidden {
  display: none;
}

.pf-mobile-opponents-btn {
  display: none;
}

.pf-game-opponent-panel {
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}

.pf-game-opponents {
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
}

.pf-game-opponent-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(75,85,99,0.85);
  background: rgba(2,6,23,0.42);
  padding: 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  cursor: pointer;
}

.pf-game-opponent-card:hover,
.pf-game-opponent-card--focused {
  border-color: rgba(250,204,21,0.9);
  box-shadow: 0 0 0 1px rgba(250,204,21,0.22);
}

.pf-game-opponent-name {
  font-size: 13px;
  font-weight: 800;
  grid-column: 1;
}

.pf-game-opponent-meta,
.pf-game-opponent-stats,
.pf-game-opponent-empty {
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-game-opponent-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  grid-column: 1;
}

.pf-game-opponent-state {
  color: var(--pf-accent);
  font-weight: 800;
  grid-column: 1;
}

.pf-game-opponent-mini {
  grid-column: 2;
  grid-row: 1 / span 4;
  display: grid;
  grid-template-columns: repeat(7, 5px);
  grid-template-rows: repeat(12, 5px);
  gap: 1px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(55,65,81,0.9);
}

.pf-game-opponent-cell {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: rgba(31,41,55,0.9);
}

.pf-game-opponent-cell--red { background: #ef4444; }
.pf-game-opponent-cell--blue { background: #3b82f6; }
.pf-game-opponent-cell--green { background: #22c55e; }
.pf-game-opponent-cell--yellow { background: #eab308; }
.pf-game-opponent-cell--garbage { background: #94a3b8; }

body.pf-game-active-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

body.pf-game-active-lock .pf-header {
  display: none;
}

body.pf-game-active-lock .pf-main {
  padding: 0;
}

body.pf-game-active-lock .pf-screen--game.pf-screen--active {
  height: 100dvh;
}

body.pf-game-active-lock .pf-game-layout {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 10px 14px;
  box-sizing: border-box;
}

body.pf-game-active-lock #pf_canvas {
  height: min(100%, calc(100dvh - 92px));
}

@media (max-width: 1100px) and (orientation: landscape) {
  .pf-game-layout {
    height: calc(100dvh - 28px);
  }

  .pf-game-main {
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) minmax(150px, 210px);
    gap: 10px;
  }

  .pf-game-nextbox,
  .pf-game-gincoming,
  .pf-game-statsbox,
  .pf-game-player-card,
  .pf-game-opponent-panel {
    padding: 8px;
  }

  #pf_canvas {
    height: min(100%, calc(100dvh - 118px));
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  body.pf-game-active-lock .pf-game-layout {
    padding: 6px;
  }

  .pf-game-layout {
    height: calc(100dvh - 28px);
    gap: 6px;
  }

  .pf-game-topbar {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  .pf-game-status {
    display: none;
  }

  .pf-game-topbar .pf-btn {
    padding: 7px 9px;
    font-size: 12px;
  }

  .pf-game-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
    position: relative;
  }

  .pf-game-opponent-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    padding: 7px 9px;
    max-height: 42dvh;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
    box-shadow: 0 16px 36px rgba(0,0,0,0.45);
  }

  .pf-game-layout--show-opponents .pf-game-opponent-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .pf-game-opponents {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .pf-game-opponent-card {
    min-width: 188px;
    padding: 7px;
    grid-template-columns: 1fr auto;
  }

  .pf-game-opponent-mini {
    display: grid;
    grid-template-columns: repeat(7, 4px);
    grid-template-rows: repeat(12, 4px);
    gap: 1px;
    padding: 3px;
  }

  .pf-game-opponent-cell {
    width: 4px;
    height: 4px;
  }

  .pf-game-player-panel {
    order: -1;
    display: grid;
    grid-template-columns: 54px minmax(72px, 0.7fr) minmax(0, 1.3fr);
    gap: 6px;
    align-items: stretch;
    position: relative;
  }

  .pf-game-nextbox {
    grid-column: 1;
    grid-row: 1;
  }

  .pf-game-gincoming,
  .pf-game-statsbox,
  .pf-game-player-card {
    padding: 7px;
  }

  .pf-game-player-card {
    display: none;
  }

  .pf-game-gincoming {
    grid-column: 2;
  }

  .pf-game-statsbox {
    grid-column: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-right: 44px;
    position: relative;
  }

  .pf-game-statsbox .pf-game-box-title {
    display: none;
  }

  .pf-mobile-opponents-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(250,204,21,0.65);
    border-radius: 6px;
    background: rgba(250,204,21,0.14);
    color: var(--pf-accent);
    font-size: 12px;
    font-weight: 900;
    touch-action: none;
  }

  .pf-game-stat-row {
    display: grid;
    gap: 2px;
    margin: 0;
    font-size: 11px;
  }

  .pf-game-board-zone {
    order: 1;
  }

  #pf_canvas {
    height: min(calc(100dvh - 106px), 90dvh);
    max-height: 100%;
    border-radius: 12px;
  }

  body.pf-game-active-lock #pf_canvas {
    height: min(calc(100dvh - 92px), 91dvh);
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .pf-game-mode-label {
    font-size: 11px;
    padding: 4px 7px;
  }

  #pf_next_canvas {
    width: 44px!important;
    height: 44px!important;
  }

  #pf_canvas {
    height: min(calc(100dvh - 96px), 91dvh);
  }
}

.pf-game-footer {
  font-size: 12px;
  color: var(--pf-text-muted);
}




/* MODALS (matchmaking + audio) */

.pf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.pf-modal.hidden {
  display: none;
}

.pf-modal-box {
  min-width: 260px;
  max-width: 360px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.04), transparent 60%),
    rgba(15,23,42,0.98);
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.9),
    0 0 0 1px rgba(15,23,42,1);
  font-size: 13px;
}

.pf-modal-box--wide {
  max-width: 420px;
}

.pf-modal-box--quit {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 18px;
  border-color: rgba(250,204,21,0.44);
  background:
    radial-gradient(circle at 18% 0, rgba(250,204,21,0.16), transparent 42%),
    linear-gradient(145deg, rgba(15,23,42,0.98), rgba(2,6,23,0.98));
}

.pf-modal-box--shop {
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
  padding: 18px;
  border-color: rgba(250,204,21,0.44);
  background:
    radial-gradient(circle at 86% 0, rgba(249,115,22,0.16), transparent 44%),
    linear-gradient(145deg, rgba(15,23,42,0.99), rgba(2,6,23,0.98));
}

.pf-modal-box--notice {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 18px;
}

.pf-modal-box--account {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 18px;
  border-color: rgba(56,189,248,0.42);
  background:
    radial-gradient(circle at 82% 0, rgba(56,189,248,0.16), transparent 42%),
    linear-gradient(145deg, rgba(15,23,42,0.99), rgba(2,6,23,0.98));
}

.pf-modal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(250,204,21,0.42);
  background: rgba(250,204,21,0.1);
  color: #facc15;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-modal-title {
  font-size: 16px;
  font-weight: 700;
}

.pf-modal-subtitle {
  font-size: 12px;
  color: var(--pf-text-muted);
  margin-bottom: 8px;
}

.pf-modal-status {
  font-size: 12px;
  color: var(--pf-text-main);
  margin: 10px 0 14px;
}

.pf-modal-status--error {
  color: #fecaca;
}

.pf-account-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--pf-text-main);
  font-size: 12px;
  font-weight: 700;
}

.pf-account-field input {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(2,6,23,0.82);
  color: var(--pf-text-main);
  padding: 0 12px;
  font: inherit;
}

.pf-account-field input:focus {
  outline: none;
  border-color: rgba(250,204,21,0.78);
  box-shadow: 0 0 0 3px rgba(250,204,21,0.12);
}

.pf-advanced-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pf-danger-action {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(248,113,113,0.45);
  background:
    radial-gradient(circle at 92% 0, rgba(248,113,113,0.18), transparent 45%),
    rgba(127,29,29,0.18);
  color: #fee2e2;
  text-align: left;
  cursor: pointer;
}

.pf-danger-action span,
.pf-danger-action small {
  display: block;
}

.pf-danger-action span {
  font-size: 14px;
  font-weight: 900;
}

.pf-danger-action small {
  margin-top: 4px;
  color: #fecaca;
  font-size: 12px;
  line-height: 1.35;
}

.pf-danger-action:hover {
  border-color: rgba(248,113,113,0.75);
  background:
    radial-gradient(circle at 92% 0, rgba(248,113,113,0.24), transparent 45%),
    rgba(127,29,29,0.24);
}

.pf-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.pf-modal-actions--split {
  justify-content: space-between;
  gap: 10px;
}

.pf-modal-actions--split .pf-btn {
  flex: 1;
}

.pf-quit-match-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 10px;
  background: rgba(15,23,42,0.72);
  color: var(--pf-text-main);
  font-size: 12px;
  line-height: 1.45;
}

.pf-modal-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--pf-text-muted);
}

/* MATCHMAKING PERSISTANT */

.pf-matchmaking-toast {
  position: fixed;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}

.pf-matchmaking-toast.hidden {
  display: none;
}

.pf-matchmaking-card {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 0px 0px 14px 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(250,204,21,0.18), transparent 38%),
    radial-gradient(circle at 88% 100%, rgba(56,189,248,0.14), transparent 36%),
    rgba(15,23,42,0.96);
  border: 1px solid rgba(148,163,184,0.32);
  box-shadow: 0 18px 45px rgba(0,0,0,0.42);
  backdrop-filter: blur(12px);
}

.pf-matchmaking-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(148,163,184,0.22);
  border-top-color: #facc15;
  border-right-color: #38bdf8;
  animation: pfMatchmakingSpin 0.85s linear infinite;
}

.pf-matchmaking-content {
  min-width: 0;
}

.pf-matchmaking-eyebrow {
  color: var(--pf-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pf-matchmaking-mode {
  margin-top: 1px;
  color: var(--pf-text-main);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-matchmaking-status {
  margin-top: 1px;
  color: var(--pf-text-muted);
  font-size: 12px;
}

.pf-matchmaking-elapsed {
  margin-top: 3px;
  color: #facc15;
  font-size: 12px;
  font-weight: 900;
}

.pf-matchmaking-cancel {
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 6px;
  background: rgba(2,6,23,0.58);
  color: var(--pf-text-main);
  font-weight: 800;
  font-size: 12px;
  padding: 8px 11px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.pf-matchmaking-cancel:hover {
  transform: translateY(-1px);
  background: rgba(239,68,68,0.18);
  border-color: rgba(248,113,113,0.7);
}

.pf-friend-room-toast {
  width: min(660px, calc(100vw - 24px));
}

.pf-friend-room-card {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.pf-friend-room-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(250,204,21,0.24), rgba(249,115,22,0.22));
  border: 1px solid rgba(250,204,21,0.42);
  color: #fef3c7;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(250,204,21,0.12);
}

.pf-friend-room-toast-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

@keyframes pfMatchmakingSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .pf-matchmaking-toast {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    transform: none;
    width: auto;
    z-index: 88;
  }

  .pf-matchmaking-card {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
    border-radius: 10px;
  }

  .pf-matchmaking-spinner {
    width: 22px;
    height: 22px;
    border-width: 2px;
  }

  .pf-matchmaking-eyebrow {
    font-size: 9px;
  }

  .pf-matchmaking-mode {
    font-size: 13px;
  }

  .pf-matchmaking-status,
  .pf-matchmaking-elapsed {
    font-size: 11px;
  }

  .pf-matchmaking-cancel {
    grid-column: auto;
    justify-self: end;
    min-height: 34px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .pf-friend-room-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .pf-friend-room-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 10px;
  }

  .pf-friend-room-toast-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .pf-friend-room-toast-actions .pf-matchmaking-cancel {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }
}

/* ÉCRAN VS PRÉ-PARTIE */

.pf-vs-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(250,204,21,0.16), transparent 34%),
    radial-gradient(circle at 80% 78%, rgba(249,115,22,0.14), transparent 36%),
    rgba(2,6,23,0.96);
}

.pf-vs-screen.hidden {
  display: none;
}

.pf-vs-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(56,189,248,0.08), transparent 35%, transparent 65%, rgba(248,113,113,0.08)),
    linear-gradient(135deg, transparent 48%, rgba(250,204,21,0.16) 49%, rgba(250,204,21,0.08) 51%, transparent 52%);
  pointer-events: none;
}

.pf-vs-inner {
  position: relative;
  width: min(940px, 100%);
  display: grid;
  gap: 18px;
}

.pf-vs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pf-vs-kicker,
.pf-vs-countdown {
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 6px;
  background: rgba(15,23,42,0.74);
  padding: 8px 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}

.pf-vs-kicker {
  color: var(--pf-text-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pf-vs-countdown {
  color: var(--pf-text-main);
  font-weight: 800;
}

.pf-vs-countdown strong {
  color: #facc15;
  font-size: 22px;
}

.pf-vs-stage {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
}

.pf-vs-player {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 360px;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 18px;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.07), transparent 48%),
    rgba(15,23,42,0.82);
  box-shadow: 0 22px 60px rgba(0,0,0,0.38);
  overflow: hidden;
}

.pf-vs-player--left {
  border-color: rgba(56,189,248,0.34);
}

.pf-vs-player--local {
  border-color: rgba(56,189,248,0.34);
}

.pf-vs-player--right,
.pf-vs-player--opponent {
  border-color: rgba(248,113,113,0.34);
}

.pf-vs-avatar-wrap {
  width: 92px;
  height: 92px;
  border-radius: 4px;
  padding: 3px;
  background: linear-gradient(135deg, #facc15, #f97316);
  box-shadow: 0 0 36px rgba(250,204,21,0.22);
}

.pf-vs-avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  background: rgba(2,6,23,0.9);
}

.pf-vs-name {
  max-width: 100%;
  color: var(--pf-text-main);
  font-size: 24px;
  font-weight: 950;
  text-align: center;
  overflow-wrap: anywhere;
}

.pf-vs-rank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 7px 12px;
  background: rgba(250,204,21,0.12);
  border: 1px solid rgba(250,204,21,0.32);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
}

.pf-vs-rank.hidden {
  display: none;
}

.pf-vs-title,
.pf-profile-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.1);
  color: #fde68a;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.pf-profile-title {
  margin-top: 4px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pf-title-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 94px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(250,204,21,0.28);
  background:
    radial-gradient(circle at 50% 0, rgba(250,204,21,0.18), transparent 62%),
    rgba(15,23,42,0.82);
  color: #fde68a;
  font-size: 15px;
  font-weight: 950;
  text-align: center;
  overflow-wrap: anywhere;
}

.pf-vs-skin {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 5px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(2,6,23,0.48);
  border: 1px solid rgba(148,163,184,0.16);
}

.pf-vs-skin img,
.pf-vs-skin-tile {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(30,41,59,0.9);
  border: 1px solid rgba(15,23,42,0.65);
}

.pf-vs-mark {
  align-self: center;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 4px;
  color: #111827;
  background: linear-gradient(135deg, #facc15, #f97316);
  font-size: 34px;
  font-weight: 1000;
  box-shadow: 0 0 42px rgba(250,204,21,0.32);
}

.pf-vs-mark--inline {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  font-size: 25px;
}

.pf-vs-stage[data-count="3"] .pf-vs-player,
.pf-vs-stage[data-count="4"] .pf-vs-player {
  min-height: 330px;
  padding: 20px 14px;
}

.pf-vs-stage[data-count="3"] .pf-vs-avatar-wrap,
.pf-vs-stage[data-count="4"] .pf-vs-avatar-wrap {
  width: 78px;
  height: 78px;
}

.pf-vs-stage[data-count="3"] .pf-vs-name,
.pf-vs-stage[data-count="4"] .pf-vs-name {
  font-size: 20px;
}

.pf-vs-stage[data-count="4"] {
  gap: 10px;
}

.pf-vs-stage[data-count="4"] .pf-vs-mark--inline {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

.pf-vs-progress {
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.22);
}

.pf-vs-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #facc15, #f97316);
  box-shadow: 0 0 18px rgba(250,204,21,0.38);
  transition: width 0.12s linear;
}

@media (max-width: 760px) {
  .pf-vs-screen {
    display: grid;
    align-items: stretch;
    justify-content: stretch;
    padding:
      max(12px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .pf-vs-inner {
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .pf-vs-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .pf-vs-kicker,
  .pf-vs-countdown {
    min-width: 0;
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
  }

  .pf-vs-countdown strong {
    font-size: 18px;
  }

  .pf-vs-stage {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    align-items: center;
    justify-items: stretch;
    gap: 10px;
    overflow: hidden;
  }

  .pf-vs-stage[data-count="2"] {
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .pf-vs-mark {
    width: 58px;
    height: 38px;
    justify-self: center;
    align-self: center;
    font-size: 17px;
    box-shadow: 0 0 28px rgba(250,204,21,0.26);
  }

  .pf-vs-player {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "avatar rank"
      "avatar title"
      "skin skin";
    align-items: center;
    justify-items: stretch;
    min-height: 0;
    height: 100%;
    gap: 7px 12px;
    padding: 12px;
    border-radius: 10px;
    overflow: hidden;
  }

  .pf-vs-name {
    grid-area: name;
    font-size: clamp(18px, 5vw, 24px);
    line-height: 1.05;
    text-align: left;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .pf-vs-title,
  .pf-vs-rank {
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.15;
    text-align: left;
    justify-content: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pf-vs-title {
    grid-area: title;
  }

  .pf-vs-rank {
    grid-area: rank;
  }

  .pf-vs-avatar-wrap {
    grid-area: avatar;
    width: 76px;
    height: 76px;
    align-self: start;
  }

  .pf-vs-skin {
    grid-area: skin;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 34px;
    gap: 5px;
    margin-top: 2px;
    padding: 6px;
    border-radius: 8px;
    align-self: end;
  }

  .pf-vs-skin img,
  .pf-vs-skin-tile {
    width: 100%;
    height: 34px;
    border-radius: 4px;
  }

  .pf-vs-stage[data-count="3"],
  .pf-vs-stage[data-count="4"] {
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
  }

  .pf-vs-stage[data-count="3"] .pf-vs-player,
  .pf-vs-stage[data-count="4"] .pf-vs-player {
    min-height: 0;
    padding: 10px;
  }

  .pf-vs-stage[data-count="3"] .pf-vs-avatar-wrap,
  .pf-vs-stage[data-count="4"] .pf-vs-avatar-wrap {
    width: 62px;
    height: 62px;
  }

  .pf-vs-stage[data-count="3"] .pf-vs-player,
  .pf-vs-stage[data-count="4"] .pf-vs-player {
    grid-template-columns: 62px minmax(0, 1fr);
  }
}

@media (max-width: 760px) and (max-height: 680px) {
  .pf-vs-screen {
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .pf-vs-inner {
    gap: 7px;
  }

  .pf-vs-player {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 5px 9px;
    padding: 9px;
  }

  .pf-vs-avatar-wrap {
    width: 62px;
    height: 62px;
  }

  .pf-vs-name {
    font-size: 17px;
    -webkit-line-clamp: 1;
  }

  .pf-vs-skin {
    grid-template-rows: 26px;
    padding: 4px;
    gap: 4px;
  }

  .pf-vs-skin img,
  .pf-vs-skin-tile {
    height: 26px;
  }

  .pf-vs-mark {
    width: 50px;
    height: 30px;
    font-size: 15px;
  }
}

/* OPTIONS AUDIO */

.pf-options-group {
  margin: 10px 0;
  padding: 8px 8px;
  border-radius: 12px;
  background: rgba(15,23,42,0.75);
  border: 1px solid rgba(55,65,81,0.9);
}

.pf-native-mobile-only {
  display: block;
}

.pf-native-mobile-app .pf-native-mobile-only {
  display: block;
}

@media (pointer: coarse) and (max-width: 900px) {
  .pf-native-mobile-only {
    display: block;
  }
}

.pf-mobile-connection-notice {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  z-index: 160;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(250,204,21,.45);
  background: rgba(15,23,42,.94);
  color: #fde68a;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.42);
}

.pf-mobile-connection-notice.hidden {
  display: none;
}

.pf-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}

.pf-options-row input[type="range"] {
  flex: 1;
}

/* UTILS */

.hidden {
  display: none;
}





/* ECRAN TITRE  */
#screen_home.pf-screen--active {
    display: flex;
    align-items: center;
}
#screen_home .pf-screen-inner {
    max-width: 1100px;
    width: 100%;
    display: block;
    margin: 0 auto;
}

#screen_home .pf-card-main {
	min-height: auto;
}
#screen_home .pf-card-grid {
	display: flex;
	grid-template-columns: 0;
	gap: 0px;
	margin-top: 0;
	align-content: center;
	align-items: flex-start;
	justify-items: stretch;
	flex-direction: column;
}

#screen_home .pf-card {
	width: 100%;
    max-width: 360px;
	border-radius: 0;
	text-transform: uppercase;
	padding: 0px 12px;
	border: 0;
	color: white;
	background: transparent;
	box-shadow: none;
	text-align: left;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition:
	transform 0.12s ease,
	box-shadow 0.12s ease,
	border-color 0.12s ease,
	background 0.12s ease;
}
#screen_home .pf-card .pf-card-title {
	background: transparent;
	text-align: left;
	padding: 0;
	font-size: 48px;
	font-style: italic;
	font-family: "Oswald", sans-serif;
	text-shadow: 0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000,0 0 2px #000;
	margin-bottom: 0;
	color: #fff;
}
#screen_home .pf-card .pf-card-title.mt {
	margin-top: 12px;
}
#screen_home .pf-card .pf-card-title.petit {
	font-size: 24px;
	font-style: normal;
}

#screen_home .pf-card:hover {
	transform: translateX(8px);
	border-color: rgba(250,204,21,0.7);
	box-shadow: 0;
}



