:root {
  color-scheme: dark;
  --bg: #110607;
  --bg-soft: rgba(24, 10, 11, 0.72);
  --panel: rgba(22, 10, 11, 0.88);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f3f7f5;
  --muted: #d8c7c9;
  --accent: #c61f2c;
  --accent-2: #8f1922;
  --accent-3: #e24a57;
  --danger: #ff7f7f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

.nav-view.nav-hidden {
  display: none !important;
}

.nav-container.nav-hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 86px;
  background:
    radial-gradient(circle at top left, rgba(198, 31, 44, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(143, 25, 34, 0.12), transparent 24%),
    linear-gradient(180deg, #130809 0%, #0d0506 58%, #060304 100%);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

html {
  scroll-padding-bottom: 90px;
}

body.pack-opening .bottom-nav {
  display: none !important;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  gap: 6px;
  width: min(520px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(20, 8, 9, 0.88);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  transform: translateX(50%);
}

.bottom-nav a {
  display: grid;
  flex: 1;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 6px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.bottom-nav a:hover,
.bottom-nav a:focus-visible,
.bottom-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.bottom-nav a svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  color: var(--accent-3);
  line-height: 1;
}

body[data-theme="light"] .bottom-nav {
  border-color: rgba(92, 10, 18, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 44px rgba(80, 18, 25, 0.14);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black 46%, transparent 100%);
  opacity: 0.35;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}

.bg-orb-1 {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -40px;
  background: rgba(198, 31, 44, 0.2);
}

.bg-orb-2 {
  width: 320px;
  height: 320px;
  right: -80px;
  top: 20vh;
  background: rgba(143, 25, 34, 0.14);
  animation-delay: -6s;
}

.app-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 0;
  position: relative;
  z-index: 1;
}

.hero-card,
.panel {
  background: linear-gradient(180deg, rgba(29, 12, 13, 0.95), rgba(16, 8, 9, 0.93));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  border-radius: 36px;
  padding: 30px;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

body[data-theme="light"] .theme-toggle {
  background: rgba(181, 19, 34, 0.08);
  border-color: rgba(181, 19, 34, 0.18);
}

body[data-theme="light"] .hero-card,
body[data-theme="light"] .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 245, 246, 0.96));
  border-color: rgba(92, 10, 18, 0.1);
  box-shadow: 0 18px 50px rgba(80, 18, 25, 0.06);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.96;
  margin-top: 18px;
  max-width: 12ch;
}

.hero-card p,
.panel p,
.card-meta {
  color: var(--muted);
  line-height: 1.6;
}

.hero-card p {
  max-width: 70ch;
  font-size: 1.02rem;
  margin-top: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #240304;
  box-shadow: 0 18px 36px rgba(198, 31, 44, 0.24);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .secondary-btn {
  background: rgba(181, 19, 34, 0.06);
  border-color: rgba(181, 19, 34, 0.12);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.stat-box {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .stat-box {
  background: rgba(181, 19, 34, 0.06);
  border-color: rgba(181, 19, 34, 0.1);
}

body[data-theme="light"] .card-art {
  background: radial-gradient(circle at top, rgba(181, 19, 34, 0.08), rgba(255, 255, 255, 0.1));
}

body[data-theme="light"] .card-image-fallback {
  color: rgba(92, 10, 18, 0.38);
}

body[data-theme="light"] .progress-bar {
  background: rgba(181, 19, 34, 0.08);
  border-color: rgba(181, 19, 34, 0.1);
}

body[data-theme="light"] .hero-card p,
body[data-theme="light"] .panel p,
body[data-theme="light"] .card-meta,
body[data-theme="light"] .stat-box small,
body[data-theme="light"] .progress-meta,
body[data-theme="light"] .tiny-pill,
body[data-theme="light"] .eyebrow,
body[data-theme="light"] .empty-state,
body[data-theme="light"] .collection-subhead p {
  color: var(--muted);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf7f8;
  --bg-soft: rgba(255, 255, 255, 0.84);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(92, 10, 18, 0.12);
  --text: #201214;
  --muted: #73565a;
  --accent: #b51322;
  --accent-2: #85131e;
  --accent-3: #d84a57;
  --danger: #b51f2f;
}

.stat-box span {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(181, 19, 34, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(216, 74, 87, 0.06), transparent 24%),
    linear-gradient(180deg, #fffdfd 0%, #f8f2f3 55%, #f0e8ea 100%);
}

.panel {
  border-radius: 30px;
  margin-top: 20px;
  padding: 24px;
}

.predictions-panel {
  margin-top: 20px;
}

.predictions-panel > summary {
  position: relative;
  padding-bottom: 30px;
  list-style: none;
  cursor: pointer;
}

.predictions-panel > summary::-webkit-details-marker {
  display: none;
}

.predictions-panel > summary::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-3);
  border-bottom: 2px solid var(--accent-3);
  transform: translateX(-50%) rotate(45deg);
  transition: transform 160ms ease;
}

.predictions-panel[open] > summary::after {
  transform: translateX(-50%) rotate(225deg);
}

.predictions-head {
  margin-bottom: 20px;
}

.predictions-head h2 {
  margin-top: 8px;
}

.predictions-head p {
  margin: 8px 0 0;
}

.predictions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prediction-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.prediction-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.prediction-match strong {
  font-size: 0.92rem;
}

.prediction-match strong:last-child {
  text-align: right;
}

.prediction-match span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.prediction-match > span:first-child {
  grid-column: 1 / -1;
  text-align: center;
}

.prediction-teams {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.prediction-team {
  min-height: 40px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.prediction-team.selected {
  border-color: var(--accent-3);
  background: rgba(198, 31, 44, 0.28);
  box-shadow: 0 0 0 2px rgba(226, 74, 87, 0.16);
}

.prediction-team:disabled {
  cursor: default;
  opacity: 0.58;
}

.prediction-team.selected:disabled {
  opacity: 1;
}

.prediction-score {
  display: none;
  align-items: center;
  gap: 6px;
}

.prediction-score input {
  width: 42px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.prediction-score input:disabled {
  opacity: 0.58;
}

.predictions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.predictions-footer > span {
  color: var(--muted);
  font-weight: 800;
}

body[data-theme="light"] .prediction-row {
  border-color: rgba(92, 10, 18, 0.1);
  background: rgba(181, 19, 34, 0.035);
}

body[data-theme="light"] .prediction-score input {
  border-color: rgba(92, 10, 18, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .prediction-team {
  border-color: rgba(92, 10, 18, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .prediction-team.selected {
  background: rgba(181, 19, 34, 0.12);
}

.pack-reveal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

.pack-reveal.hidden {
  display: none;
}

.pack-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 3, 0.72);
  backdrop-filter: blur(12px);
}

.pack-reveal-dialog {
  position: relative;
  width: max-content;
  max-width: calc(100vw - 24px);
  justify-self: center;
  border-radius: 30px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(34, 12, 13, 0.96), rgba(15, 6, 7, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.pack-reveal.visible .pack-reveal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pack-reveal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.pack-reveal-title span {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pack-reveal-title strong {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
}

.pack-reveal-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  justify-content: center;
}

.pack-reveal-card {
  grid-column: span 2;
}

.pack-reveal-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.pack-reveal-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.pack-reveal-card {
  animation: packCardIn 380ms ease both;
}

.pack-reveal-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

body[data-theme="light"] .pack-reveal-dialog {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 243, 244, 0.96));
  border-color: rgba(92, 10, 18, 0.12);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: 2rem;
}

.pack-panel-head h2.compact-panel-title {
  font-size: 1.5rem;
}

.pack-panel-head p {
  max-width: 56ch;
  font-size: 0.95rem;
}

.pack-panel-head .tiny-pill {
  padding: 7px 10px;
  font-size: 0.82rem;
}

.tiny-pill {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
}

.pack-grid,
.collection-grid {
  display: grid;
  gap: 16px;
}

.pack-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.collection-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.five-panel {
  margin: 10px 0 24px;
  padding: 18px;
  border: 1px solid rgba(198, 31, 44, 0.22);
  border-radius: 20px;
  background: rgba(198, 31, 44, 0.06);
}

.leaderboard-panel {
  margin: 18px 0 28px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.leaderboard-head {
  margin-bottom: 14px;
}

.leaderboard-head h3 {
  margin-top: 8px;
}

.leaderboard-head p {
  margin: 6px 0 0;
  font-size: 0.86rem;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.leaderboard-rank {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 26px;
  color: var(--accent-3);
  font-weight: 800;
  text-align: center;
}

.leaderboard-name-1 {
  color: #e6bd55;
}

.leaderboard-name-2 {
  color: #c4ccd6;
}

.leaderboard-name-3 {
  color: #c98555;
}

.leaderboard-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-gap {
  width: 42%;
  height: 1px;
  margin: 10px auto;
  background: rgba(226, 74, 87, 0.35);
}

.leaderboard-score {
  color: var(--accent-3);
  font-weight: 800;
}

.leaderboard-own-row {
  border: 1px solid rgba(226, 74, 87, 0.4);
  background: rgba(198, 31, 44, 0.12);
}

body[data-theme="light"] .leaderboard-panel {
  border-color: rgba(92, 10, 18, 0.1);
  background: rgba(181, 19, 34, 0.035);
}

body[data-theme="light"] .leaderboard-row {
  background: rgba(181, 19, 34, 0.05);
}

.five-head {
  margin: 0 0 16px;
}

.five-head p {
  margin: 5px 0 0;
}

.five-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.five-total-block {
  text-align: center;
}

.five-total {
  display: table;
  align-items: center;
  margin-left: auto !important;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(226, 74, 87, 0.4);
  border-radius: 999px;
  background: rgba(198, 31, 44, 0.16);
  color: var(--text) !important;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

body[data-theme="light"] .five-total {
  border-color: rgba(181, 19, 34, 0.28);
  background: rgba(181, 19, 34, 0.1);
  color: var(--accent-2) !important;
}

.five-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.five-slot {
  min-width: 0;
  cursor: pointer;
}

.five-clear-btn {
  display: block;
  margin: 16px auto 0;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.five-save-btn {
  display: block;
  margin: 10px auto 0;
  padding: 10px 14px;
  font-size: 0.82rem;
}

.five-save-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.weekly-five-panel {
  margin: 24px 0 30px;
  padding: 18px;
  border: 1px solid rgba(226, 74, 87, 0.22);
  border-radius: 22px;
  background: rgba(198, 31, 44, 0.045);
}

.weekly-five-panel > .five-panel-head {
  margin-bottom: 16px;
}

.weekly-five-panel .five-title-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.weekly-five-panel .five-title-block .weekly-five-rewards {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

body[data-theme="light"] .weekly-five-panel {
  border-color: rgba(181, 19, 34, 0.16);
  background: rgba(181, 19, 34, 0.035);
}

.five-slot-empty {
  cursor: pointer;
}

.five-slot:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 4px;
}

.five-picker-content {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100vw - 24px));
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(34, 12, 13, 0.98), rgba(15, 6, 7, 0.97));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
}

.five-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.five-picker-card {
  cursor: pointer;
}

.five-picker-card.is-five-unavailable {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(1);
}

.five-picker-card.is-five-unavailable .card-art {
  filter: saturate(0.2) brightness(0.7);
}

body[data-theme="light"] .five-picker-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 243, 244, 0.98));
  border-color: rgba(92, 10, 18, 0.12);
}

.five-card {
  min-width: 0;
}

.five-card .player-position {
  display: none;
}

.card:not(.is-unowned) {
  cursor: pointer;
}

.five-slot-empty {
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: var(--muted);
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
}

.five-slot-plus {
  color: inherit;
  font-family: "Inter", sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
}

.five-slot-empty > span:last-child {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

body[data-theme="light"] .five-panel {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(181, 19, 34, 0.16);
}

body[data-theme="light"] .five-slot-empty {
  border-color: rgba(92, 10, 18, 0.2);
}

.pack-reveal-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  justify-content: center;
}

.collection-subhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 30px 10px 16px;
}

.collection-season {
  margin-top: 18px;
  padding: 0 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.collection-season > summary {
  list-style: none;
  cursor: pointer;
}

.collection-season > summary::-webkit-details-marker {
  display: none;
}

.collection-season > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--accent-3);
  border-bottom: 2px solid var(--accent-3);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 160ms ease;
}

.collection-season[open] > summary::after {
  transform: rotate(225deg) translateY(-3px);
}

body[data-theme="light"] .collection-season {
  border-color: rgba(92, 10, 18, 0.1);
  background: rgba(181, 19, 34, 0.025);
}

.collection-subhead h3 {
  font-size: 1.3rem;
}

.collection-subhead p {
  margin: 0;
  max-width: 60ch;
}

.collection-subhead-spaced {
  margin-top: 25px;
  padding-top: 25px;
  position: relative;
}

.collection-subhead-spaced::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
}

.special-grid .card {
  opacity: 0.95;
}

.card.is-unowned {
  position: relative;
}

.card.is-unowned::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.card.is-unowned .card-art img,
.card.is-unowned .card-image-fallback {
  filter: grayscale(1) saturate(0.25) brightness(0.58) contrast(0.92);
}

.card.is-unowned .player-name,
.card.is-unowned .rarity {
  position: relative;
  z-index: 1;
}

.card.is-unowned .card-art {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.35);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.05));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 20px;

  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.card-art {
  position: relative;
  aspect-ratio: 5 / 7;
  overflow: hidden;
  border-radius: 10px;
  margin: 0;
}

.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(16, 8, 9, 0.78);
  color: #fff7f8;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.card-rating[hidden] {
  display: none;
}

.card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  padding: 0;
}

.player-name {
  margin: 0;
  min-height: auto;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: 700;
}

.player-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(198, 31, 44, 0.35);
  border-radius: 999px;
  color: var(--accent-3);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.rarity {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

.card .card-art {
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
}

.card .card-art::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 10px;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 45%, transparent 55%);
  transform: translateX(-40%) rotate(8deg);
  animation: sheenSweep 3.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 2;
}

.modal-card .card-art::before {

  background:
    linear-gradient(120deg,
      transparent 20%,
      rgba(255, 255, 255, .35) 35%,
      rgba(255, 255, 255, .9) 50%,
      rgba(255, 255, 255, .35) 65%,
      transparent 80%);

  opacity: .9;
}


.card.is-special .card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%, rgba(0, 0, 0, 0.18));
}

.card.is-special[data-rarity="bronze"] {
  border-color: rgba(143, 92, 54, 0.34);
  border-radius: 10px;
}

.card.is-special[data-rarity="bronze"] .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 10px rgba(143, 92, 54, 0.5);
}

.card.is-special[data-rarity="bronze"] .card-art::before {
  z-index: 2;
  border-radius: 10px;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 225, 198, 0.22) 45%, transparent 56%);
}

.card.is-special[data-rarity="bronze"] .card-art::after {
  z-index: 3;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 225, 198, 0.35), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(80, 50, 30, 0.18));
}

.card.is-special[data-rarity="bronze"].is-unowned .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.card.is-special[data-rarity="silver"] {
  border-color: rgba(185, 197, 213, 0.4);
  border-radius: 10px;
}

.card.is-special[data-rarity="silver"] .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 10px rgba(185, 197, 213, 0.5);
}

.card.is-special[data-rarity="silver"].is-unowned .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.card.is-special[data-rarity="silver"] .card-art::before {
  z-index: 2;
  border-radius: 10px;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.34) 45%, transparent 58%);
}

.card.is-special[data-rarity="silver"] .card-art::after {
  z-index: 3;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(80, 80, 80, 0.18));
}

.card.is-special[data-rarity="gold"] {
  border-color: rgba(225, 191, 92, 0.45);
  border-radius: 10px;
}

.card.is-special[data-rarity="gold"] .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 10px #e1bf5c80;
}

.card.is-special[data-rarity="gold"].is-unowned .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.card.is-special[data-rarity="gold"] .card-art::before {
  z-index: 2;
  border-radius: 10px;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 250, 212, 0.36) 45%, transparent 60%);
}

.card.is-special[data-rarity="gold"] .card-art::after {
  z-index: 3;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 223, 133, 0.35), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(80, 50, 0, 0.18));
}

.card.is-special[data-rarity="evenement"] {
  border-color: rgba(125, 125, 125, 0.35);
  border-radius: 10px;
}

.card.is-special[data-rarity="evenement"] .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 10px rgba(125, 125, 125, 0.35);
}

.card.is-special[data-rarity="evenement"].is-unowned .card-art {
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.card.is-special[data-rarity="evenement"] .card-art::before {
  z-index: 2;
  border-radius: 10px;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.30) 45%, transparent 60%);
}

.card.is-special[data-rarity="evenement"] .card-art::after {
  z-index: 3;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.20), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.18));
}

/* =========================================================
   COULEUR DES CARTES ÉVÉNEMENT PAR TYPE
   ========================================================= */

/* Flashback : bleu */
.card.is-special[data-event-type="flashback"] {
  border-color: rgba(0, 123, 255, 0.35);
}

.card.is-special[data-event-type="flashback"] .card-art {
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.card.is-special[data-event-type="flashback"] .card-art::before {
  background: linear-gradient(115deg, transparent 30%, rgba(0, 123, 255, 0.36) 45%, transparent 60%);
}

.card.is-special[data-event-type="flashback"] .card-art::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 123, 255, 0.35), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(0, 80, 255, 0.18));
}

/* Homme du match : rouge */
.card.is-special[data-event-type="homme_du_match"] {
  border-color: rgba(220, 38, 38, 0.55);
}

.card.is-special[data-event-type="homme_du_match"] .card-art {
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.65);
}

.card.is-special[data-event-type="homme_du_match"] .card-art::before {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 80, 80, 0.42) 45%, transparent 60%);
}

.card.is-special[data-event-type="homme_du_match"] .card-art::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 55, 55, 0.42), transparent 35%),
    linear-gradient(180deg, transparent 60%, rgba(140, 0, 0, 0.22));
}


/* STAR : blanc nacré lumineux */

.card.is-special[data-event-type="star"] .card-art {
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.5),
    0 0 24px rgba(210, 230, 255, 0.28);
}

.card.is-special[data-event-type="star"] .card-art::before {
  background: linear-gradient(
    115deg,
    transparent 28%,
    rgba(255, 255, 255, 0.15) 36%,
    rgba(255, 255, 255, 0.95) 48%,
    rgba(225, 240, 255, 0.55) 53%,
    transparent 65%
  );
}

.card.is-special[data-event-type="star"] .card-art::after {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.42),
      transparent 40%
    ),
    linear-gradient(
      180deg,
      transparent 58%,
      rgba(180, 200, 225, 0.16)
    );
}

/* Badge STAR : thème sombre */
.card.is-special[data-event-type="star"] .rarity.evenement {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* Badge STAR : thème clair */
body[data-theme="light"]
.card.is-special[data-event-type="star"] .rarity.evenement {
  background: rgba(225, 235, 250, 0.7);
  color: #35445C;
  border-color: rgba(120, 140, 170, 0.6);
  box-shadow: 0 0 8px rgba(160, 180, 210, 0.15);
}

/* legende : or clair */
.card.is-special[data-event-type="legende"] {
  border-color: rgba(255, 215, 0, 0.55);
}

.card.is-special[data-event-type="legende"] .card-art {
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.65);
}

.card.is-special[data-event-type="legende"] .card-art::before {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 250, 212, 0.42) 45%, transparent 60%);
}

.card.is-special[data-event-type="legende"] .card-art::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 223, 133, 0.42), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(140, 120, 0, 0.22));
}

.card-art img,
.card-image-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-art img {
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 1;
  border-radius: 10px;
}

.card-art img.loaded {
  opacity: 1;
}

.card-image-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
}

.rarity,
.owned-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rarity.base {
  background: rgba(198, 31, 44, 0.16);
  color: #ffe8eb;
}

body[data-theme="light"] .owned-tag {
  color: #5b0c16;
}

body[data-theme="light"] .owned-tag {
  background: rgba(181, 19, 34, 0.12);
}

.rarity.bronze {
  background: rgba(143, 25, 34, 0.18);
  color: #ffd5da;
}

.rarity.silver {
  background: rgba(198, 31, 44, 0.1);
  color: #fff1f2;
}

.rarity.gold {
  background: rgba(143, 25, 34, 0.22);
  color: #fff7f8;
}

.rarity.evenement {
  background: rgba(0, 123, 255, 0.2);
  color: #d0eaff;
}

.owned-tag {
  background: rgba(198, 31, 44, 0.14);
  color: #ffe5ea;
}

.hidden {
  display: none;
}

.player-name {
  font-size: 1.25rem;
  min-height: 2.5em;
}

.card-meta {
  display: none;
}

.pack-reveal-card .card-meta {
  display: block;
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pack-reveal-card .card-body {
  gap: 0;
}

.progress-wrap {
  margin-bottom: 20px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 300ms ease;
}

.collection-status {
  margin-top: 12px;
  color: var(--muted);
}

.card.is-new {
  border-color: rgba(198, 31, 44, 0.42);
}

.card.is-special {
  border-color: rgba(143, 25, 34, 0.22);
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(18px, -12px, 0) scale(1.04);
  }
}

@keyframes packCardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sheenSweep {
  0% {
    transform: translateX(-120%) rotate(8deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  55% {
    transform: translateX(120%) rotate(8deg);
    opacity: 1;
  }

  70% {
    opacity: 0;
  }

  100% {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 1200px);
    padding-top: 10px;
  }

  .hero-card,
  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-box span {
    font-size: 1.4rem;
  }

  .card-rating {
    top: 6px;
    right: 6px;
    width: 24px;
    font-size: 0.62rem;
  }

  .pack-grid,
  .collection-grid,
  .five-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .five-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }

  .five-grid .five-slot {
    grid-column: span 2;
  }

  .five-grid .five-slot:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .five-grid .five-slot:nth-child(5) {
    grid-column: 4 / span 2;
  }

  .five-panel {
    padding: 12px 8px;
  }

  .prediction-row {
    gap: 12px;
  }

  .predictions-grid {
    grid-template-columns: 1fr;
  }

  .predictions-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .five-panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .five-title-block h2 {
    white-space: nowrap;
  }

  .five-total {
    margin-left: auto !important;
    font-size: 0.82rem;
  }

  .five-grid .player-name {
    font-size: 0.62rem;
    overflow-wrap: anywhere;
  }

  .five-grid .player-position {
    min-width: 20px;
    padding: 2px 5px;
    font-size: 0.58rem;
  }

  .five-grid .five-slot-plus {
    font-size: 1.15rem;
  }

  .five-grid .five-slot-empty {
    gap: 3px;
  }

  .five-grid .five-slot-empty > span:last-child {
    font-size: 0.55rem;
    line-height: 1.1;
  }

  .five-picker-content {
    padding: 16px;
  }

  .five-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  }

  .pack-panel-head h2.compact-panel-title {
    font-size: 1.35rem;
  }

  .pack-reveal-title {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Cartes */

  .card-body {
    padding: 10px;
  }

  .player-name {
    font-size: 0.95rem;
    min-height: 2.2em;
    line-height: 1.15;
  }

  .rarity {
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .card-art {
    margin: 6px;
  }

  /* Titres */

  h1 {
    font-size: 2.3rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .hero-card p,
  .panel p,
  .collection-subhead p {
    font-size: 0.9rem;
  }

body[data-theme="light"] .card.is-unowned .card-art img,
body[data-theme="light"] .card.is-unowned .card-image-fallback {
  filter: grayscale(0.7) saturate(0.6) brightness(1.15) contrast(0.9);
}

footer.app-footer {
  margin-top: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  width: min(1200px, calc(100vw - 32px));
  ;
  margin: 0 auto;
  margin-bottom: 20px;
}

.empty-special-text {
  color: var(--muted);
  margin: 20px 0;
  font-size: 0.95rem;
}

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}


.card-modal.hidden {
  display: none;
}


.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
}


.card-modal-content {
  position: relative;
  z-index: 2;
  animation: modalCardIn 250ms ease;
}

.card-modal-close {
  position: absolute;
  right: 5px;
  top: 0;

  width: 34px;
  height: 34px;

  border-radius: 50%;
  border: none;

  background: rgba(0, 0, 0, 0.4);

  color: white;
  font-size: 22px;

  cursor: pointer;
  z-index: 5;
}


.modal-card {
  width: min(380px, 80vw);
  transform: scale(1.05);
}


.modal-card .card-art {
  aspect-ratio: 5 / 7;
}



@keyframes modalCardIn {

  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }

}

.pack-back-card {
  width: 217px;
  aspect-ratio: 5 / 7;
  border-radius: 10px;

  display: grid;
  place-items: center;

  text-align: center;

  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;

  color: white;

  background:
    radial-gradient(circle at top,
      rgba(198, 31, 44, 0.45),
      rgba(20, 5, 7, 0.95));

  border: 2px solid rgba(255, 255, 255, 0.15);

  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5);

  cursor: pointer;

  animation: packCardIn 300ms ease;
}

.card-reveal-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
}

.card-reveal-stage.hidden {
  display: none;
}


.pack-back-card {
  width: 217px;
  aspect-ratio: 5 / 7;
  border-radius: 10px;

  display: grid;
  place-items: center;

  color: white;
  text-align: center;

  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: .08em;

  background:
    radial-gradient(circle at top,
      rgba(198, 31, 44, .45),
      rgba(10, 5, 6, .95));

  border: 2px solid rgba(255, 255, 255, .15);

  cursor: pointer;

  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

/* Taille des cartes pendant l'ouverture du pack */
.card-reveal-stage .card {
  width: 320px;
}

.card-reveal-stage .card-art {
  width: 320px;
}


/* Dos de carte ROAZHON CARDS */
.card-reveal-stage .pack-back-card {
  width: 320px;
  font-size: 2rem;
}

@media (max-width: 760px) {

  .card-reveal-stage .card,
  .card-reveal-stage .card-art,
  .card-reveal-stage .pack-back-card {
    width: 75vw;
    max-width: 320px;
  }

}

body[data-theme="light"] .card-reveal-stage {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

body[data-theme="light"] .pack-reveal-backdrop {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

@keyframes cardRevealPop {

  0% {
    opacity: 0;
    transform: scale(0.65) rotateY(90deg);
    filter: brightness(2);
  }

  45% {
    opacity: 1;
    transform: scale(1.12) rotateY(-8deg);
    filter: brightness(1.4);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    filter: brightness(1);
  }

}


.reveal-animation {
  animation: cardRevealPop 450ms cubic-bezier(0.22, 1, 0.36, 1);
}


.card-reveal-stage .card,
.card-reveal-stage .pack-back-card {
  animation: cardRevealPop 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-animation {
  animation: cardRevealPop 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-reveal-stage::after {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(circle,
      rgba(255, 255, 255, 0.75),
      transparent 45%);

  opacity: 0;
  pointer-events: none;
}


.card-reveal-stage.flash::after {
  animation: revealFlash 350ms ease-out;
}


.card-reveal-stage::after {
  background: radial-gradient(circle,
      rgba(230, 236, 244, 0.95),
      transparent 50%);

  animation: revealFlash 1500ms ease-out;
}

.card-reveal-stage::after {
  animation: revealFlash 600ms ease-out;
}

@keyframes cardShake {

  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  15% {
    transform: translateX(-8px) rotate(-3deg);
  }

  30% {
    transform: translateX(8px) rotate(3deg);
  }

  45% {
    transform: translateX(-6px) rotate(-2deg);
  }

  60% {
    transform: translateX(6px) rotate(2deg);
  }

  75% {
    transform: translateX(-3px) rotate(-1deg);
  }

}


.card-reveal-stage.shake .pack-back-card {
  animation: cardShake 450ms ease;
}

/* Base */
.rarity.base {
  background: rgba(120, 120, 120, 0.22);
  color: #f2f2f2;
  border: 1px solid rgba(180, 180, 180, 0.35);
}

/* Bronze */
.rarity.bronze {
  background: rgba(181, 120, 45, 0.22);
  color: #ffdcb8;
  border: 1px solid rgba(215, 150, 70, 0.4);
}

/* silver */
.rarity.silver {
  background: rgba(185, 197, 213, 0.20);
  color: #f7fbff;
  border: 1px solid rgba(220, 228, 240, 0.45);
}

/* Or */
.rarity.gold {
  background: rgba(255, 210, 70, 0.22);
  color: #fff7d1;
  border: 1px solid rgba(255, 223, 120, 0.5);
}

/* Evenement */
.rarity.evenement {
  background: rgba(0, 123, 255, 0.2);
  color: #d0eaff;
  border: 1px solid rgba(0, 123, 255, 0.35);
}

body[data-theme="light"] .rarity.base {
  background: rgba(120, 120, 120, 0.15);
  color: #444;
}

body[data-theme="light"] .rarity.bronze {
  background: rgba(181, 120, 45, 0.18);
  color: #6f3f12;
}

body[data-theme="light"] .rarity.silver {
  background: rgba(210, 218, 230, 0.45);
  color: #4b5563;
}

body[data-theme="light"] .rarity.gold {
  background: rgba(255, 220, 90, 0.30);
  color: #6b4b00;
}

body[data-theme="light"] .rarity.evenement {
  background: rgba(0, 123, 255, 0.2);
  color: #1e3a8a;
}

body[data-theme="light"] .card-modal-backdrop {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

.primary-btn.disabled,
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.card,
.modal-card {
  transform-style: preserve-3d;
  perspective: 1200px;
}

.card-art {
  transition: transform .08s linear;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: grab;
}

.card-art:active {
  cursor: grabbing;
}

#cardRevealStage .card[data-rarity="bronze"] .card-art {
  box-shadow: 0 0 20px rgba(143, 92, 54, 0.6);
}

#cardRevealStage .card[data-rarity="silver"] .card-art {
  box-shadow: 0 0 20px rgba(185, 197, 213, 0.6);
}

#cardRevealStage .card[data-rarity="gold"] .card-art {
  box-shadow: 0 0 20px rgba(225, 191, 92, 0.6);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(6px);
}

.loading-overlay.hidden {
  display: none;
}

.loading-overlay>div,
.loading-overlay {
  font-family: inherit;
}

.loading-overlay {
  text-align: center;
}

.loading-overlay .loader {
  margin: 0 auto 8px;
}

.loading-overlay p {
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.player-subtitle{
    margin-top:2px;
    font-size:11px;
    color:#d7d7d7;
    text-align:center;
    line-height:1.2;
    font-style:italic;
    margin-bottom:6px;
}

.card.is-new {
  position: relative;
  overflow: visible;
}

.card.is-new::after {
  content: "NEW";

  font-style: italic;

  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 13px;
  border-radius: 10px;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.06)
  );

  color: rgba(245, 245, 245, 0.9);

  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.3);

  border: 1px solid rgba(255, 255, 255, 0.28);

  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

body[data-theme="light"] .card.is-new::after {
  background: rgba(181, 19, 34, 0.12);
  color: #6f111d;
  text-shadow: none;
  border-color: rgba(181, 19, 34, 0.28);
  box-shadow: 0 4px 12px rgba(92, 10, 18, 0.12);
}

body[data-theme="light"] .player-subtitle {
  color: #60464a;
}

body[data-theme="light"] .card[data-event-type="flashback"] .rarity.evenement {
  color: #164e63;
  border-color: rgba(14, 116, 144, 0.4);
}

body[data-theme="light"] .card[data-event-type="homme_du_match"] .rarity.evenement {
  color: #8f1d2a;
  border-color: rgba(185, 28, 28, 0.4);
}

body[data-theme="light"] .card.is-special[data-event-type="legende"] .rarity.evenement {
  color: #6b4b00;
  border-color: rgba(255, 223, 120, 0.5);
}



/* Badge événement : couleur adaptée au type */
.rarity.evenement {
  background: rgba(125, 125, 125, 0.18);
  color: #f2f2f2;
}

.card[data-event-type="flashback"] .rarity.evenement {
  background: rgba(0, 123, 255, 0.20);
  color: #d0eaff;
  border: 1px solid rgba(0, 123, 255, 0.35);
}

.card[data-event-type="homme_du_match"] .rarity.evenement {
  background: rgba(220, 38, 38, 0.22);
  color: #ffe0e0;
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.card[data-event-type="legende"] .rarity.evenement {
  background: rgba(255, 215, 0, 0.22);
  color: #fff7d1;
  border: 1px solid rgba(255, 223, 120, 0.5);
}
  
.promo-code-section {
  width: min(1200px, calc(100vw - 32px));
  margin: 32px auto 0;
  position: relative;
  z-index: 1;
}

.promo-code-box {
  border-radius: 28px;
  padding: 26px;
  background:
    linear-gradient(
      180deg,
      rgba(29, 12, 13, 0.95),
      rgba(16, 8, 9, 0.93)
    );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  margin-bottom: 32px;
}

.promo-code-content {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}

.promo-code-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.promo-code-content h2 {
  margin: 0;
  font-size: 1.7rem;
}

.promo-code-content p {
  margin: 6px 0 0;
  color: var(--muted);
}

.promo-code-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

#promoCodeInput {
  width: 220px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.14);

  background: rgba(255, 255, 255, 0.06);

  color: var(--text);

  font: inherit;
  font-weight: 700;

  outline: none;

  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

#promoCodeInput::placeholder {
  color: var(--muted);
}

#promoCodeInput:focus {
  border-color: rgba(198, 31, 44, 0.7);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(198, 31, 44, 0.12);
}

.promo-code-message {
  grid-column: 1 / -1;
  margin: 0 !important;
  min-height: 20px;
  font-size: 0.9rem;
  font-weight: 700;
}

.promo-code-message.success {
  color: #7ee2a8;
}

.promo-code-message.error {
  color: var(--danger);
}

body[data-theme="light"] .promo-code-box {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(249, 245, 246, 0.96)
    );

  border-color: rgba(92, 10, 18, 0.1);
}

body[data-theme="light"] #promoCodeInput {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(181, 19, 34, 0.14);
}

body[data-theme="light"] #promoCodeInput:focus {
  background: rgba(181, 19, 34, 0.07);
}

@media (max-width: 760px) {

  .promo-code-section {
    width: min(100vw - 20px, 1200px);
  }

  .promo-code-box {
    padding: 20px;
  }

  .promo-code-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .promo-code-form {
    flex-direction: column;
    align-items: stretch;
  }

  #promoCodeInput {
    width: 100%;
  }

  .promo-code-form .primary-btn {
    width: 100%;
  }

}

.bonus-packs {
  display: block;
  font-size: 0.85em;
  opacity: 0.8;
  margin-top: 3px;
}

.admin-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  position: relative;
  z-index: 1;
}

.admin-header h1 {
  max-width: none;
}

.admin-header {
  background:
    linear-gradient(120deg, rgba(198, 31, 44, 0.2), transparent 48%),
    var(--panel);
}

.admin-panel {
  margin-top: 18px;
}

.admin-back-link,
.admin-footer-link {
  text-decoration: none;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit;
}

.admin-event-fields {
  display: contents;
}

.admin-form > button,
.admin-message {
  grid-column: 1 / -1;
}

.admin-message {
  margin: 0;
  color: var(--accent-3);
}

.admin-settings-form {
  display: grid;
  gap: 18px;
}

.admin-settings-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-settings-group::before {
  grid-column: 1 / -1;
  color: var(--text);
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
}

#adminRaritySettings::before {
  content: "Raretés";
}

#adminEventSettings::before {
  content: "Événements";
}

.admin-settings-group label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-settings-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.admin-cards-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-card-row {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.admin-card-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--card-accent, var(--accent));
}

.admin-card-row:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 55%, var(--panel-border));
  background: rgba(255, 255, 255, 0.06);
}

.admin-card-row strong {
  color: var(--text);
}

.admin-card-editor {
  display: grid;
  gap: 12px;
}

.admin-card-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.admin-card-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-card-value {
  min-width: 0;
  padding: 2px 0;
}

.admin-card-value span,
.admin-card-actions span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-card-value strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-value:first-child {
  grid-column: 1 / -1;
}

.admin-card-value:first-child strong {
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
}

.admin-rarity-base { --card-accent: #a7b0b8; }
.admin-rarity-bronze { --card-accent: #c98655; }
.admin-rarity-silver { --card-accent: #b8c8d8; }
.admin-rarity-gold { --card-accent: #e5bd55; }
.admin-rarity-evenement { --card-accent: #e24a57; }

.admin-card-fields input,
.admin-card-fields select {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.admin-enabled-field {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.admin-card-actions {
  display: grid;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 112px;
  text-align: right;
}

.admin-card-actions strong {
  color: var(--accent-3);
  font-size: 1.2rem;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.admin-summary-item {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-summary-item span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-summary-item strong {
  font-family: "Fraunces", serif;
  font-size: 1.55rem;
}

.admin-summary-highlight {
  border-color: rgba(226, 74, 87, 0.4);
  background: rgba(226, 74, 87, 0.08);
}

.admin-catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  align-items: end;
  gap: 12px;
  margin: 4px 0 18px;
}

.admin-search-field,
.admin-filter-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-search-field input,
.admin-filter-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.admin-search-field input:focus,
.admin-filter-field select:focus {
  outline: 2px solid rgba(226, 74, 87, 0.45);
  outline-offset: 1px;
}

.admin-results-count {
  padding-bottom: 11px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

body[data-theme="light"] .admin-card-row,
body[data-theme="light"] .admin-summary-item {
  background: rgba(181, 19, 34, 0.035);
}

body[data-theme="light"] .admin-search-field input,
body[data-theme="light"] .admin-filter-field select {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(92, 10, 18, 0.18);
}

.admin-card-actions .primary-btn {
  padding: 9px 12px;
  font-size: 0.78rem;
}

.admin-footer-link {
  color: var(--muted);
  font-size: 0.8rem;
}

body[data-theme="light"] .admin-form input,
body[data-theme="light"] .admin-form select {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(92, 10, 18, 0.18);
}

body[data-theme="light"] .admin-card-fields input,
body[data-theme="light"] .admin-card-fields select {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(92, 10, 18, 0.18);
}

body[data-theme="light"] .admin-settings-group input {
  background: rgba(181, 19, 34, 0.05);
  border-color: rgba(92, 10, 18, 0.18);
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100vw - 20px, 900px);
    padding-top: 10px;
  }

  .admin-form,
  .admin-card-fields,
  .admin-settings-group {
    grid-template-columns: 1fr;
  }

  .admin-summary,
  .admin-catalog-tools,
  .admin-cards-list {
    grid-template-columns: 1fr;
  }

  .admin-catalog-tools {
    align-items: stretch;
  }

  .admin-results-count {
    padding-bottom: 0;
  }

  .admin-card-row {
    display: grid;
    align-items: stretch;
  }

  .admin-card-actions {
    justify-content: start;
    min-width: 0;
    text-align: left;
  }
}


/* Styles extracted from app.js */
#packReveal {
  overflow: hidden;
}

#packReveal .pack-reveal-dialog {
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

#packReveal #addPackToCollectionBtn {
  scroll-margin-bottom: 16px;
}

.card-rating-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 7px;
  min-height: 24px;
}

.card-rating {
  position: static;
  inset: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  box-sizing: border-box;
  padding: 2px 7px;
  border: 1px solid #b9a889;
  border-radius: 6px;
  background: #f4f0e8;
  color: #201b18;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
  box-shadow: 0 1px 3px #0002;
  pointer-events: none;
}

.card-rating-bonus {
  position: static;
  display: inline;
  text-shadow: none;
  background: transparent;
  color: #f4f0e8;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 850;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}

body[data-theme="light"] .card-rating-bonus {
  color: rgb(32, 27, 24);
}

.five-picker-sort-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  width: 100%;
  box-sizing: border-box;
}

.five-picker-sort-label {
  font-size: 0.9rem;
  white-space: nowrap;
}

.five-picker-sort-select {
  max-width: 160px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #514047;
  background: #21191d;
  color: #f4f0e8;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.five-picker-sort-select option {
  background: #21191d;
  color: #f4f0e8;
}

body[data-theme="light"] .five-picker-sort-select {
  border-color: #d8c5c9;
  background: #fff8f7;
  color: #302126;
}

body[data-theme="light"] .five-picker-sort-select option {
  background: #fff8f7;
  color: #302126;
}


/* Popup affichant le Five associé à une entrée du classement */
.leaderboard-name-button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}
.leaderboard-name-button:hover,
.leaderboard-name-button:focus,
.leaderboard-name-button:focus-visible,
.leaderboard-name-button:active {
  text-decoration: none;
  outline: none;
}
.leaderboard-name-button.leaderboard-name-1 { color: #e6bd55; }
.leaderboard-name-button.leaderboard-name-2 { color: #c4ccd6; }
.leaderboard-name-button.leaderboard-name-3 { color: #c98555; }
.leaderboard-five-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.leaderboard-five-modal-backdrop.hidden { display: none; }
.leaderboard-five-modal-backdrop.visible { display: grid; }
.leaderboard-five-modal {
  position: relative;
  width: min(100%, 1000px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(226, 74, 87, 0.3);
  border-radius: 22px;
  background: var(--panel, #17171d);
  color: var(--text, #fff);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.leaderboard-five-modal h2 { margin: 6px 40px 8px 0; }
.leaderboard-five-modal-score { margin: 0 0 22px; color: var(--accent-3); font-weight: 800; }
.leaderboard-five-modal-close {
  position: absolute;
  top: 20px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.leaderboard-five-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.leaderboard-five-card { min-width: 0; }
.leaderboard-five-modal-status { margin: 12px 0 0; font-size: .9rem; }
body[data-theme="light"] .leaderboard-five-modal {
  background: var(--panel, #fff);
  color: var(--text, #211f24);
}
@media (max-width: 680px) {
  .leaderboard-five-modal { padding: 14px 14px; }
  /* Sur mobile : trois cartes en haut, deux cartes centrées en bas. */
  .leaderboard-five-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .leaderboard-five-grid .leaderboard-five-card { grid-column: span 2; }
  .leaderboard-five-grid .leaderboard-five-card:nth-child(4) { grid-column: 2 / span 2; }
  .leaderboard-five-grid .leaderboard-five-card:nth-child(5) { grid-column: 4 / span 2; }
}

/* =========================================================
   AMIS ET CLASSEMENT ENTRE AMIS
   ========================================================= */
.friends-panel {
  margin: 18px 0 28px;
  padding: 18px;
  border: 1px solid rgba(198, 31, 44, 0.22);
  border-radius: 20px;
  background: rgba(198, 31, 44, 0.045);
}
.friends-head { margin-bottom: 18px; }
.friends-search-form { display: grid; gap: 8px; margin-bottom: 8px; }
.friends-search-label { color: var(--muted); font-size: .86rem; font-weight: 700; }
.friends-search-line { display: flex; gap: 8px; }
.friends-search-input {
  flex: 1; min-width: 0; padding: 11px 13px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.18);
  color: var(--text); font: inherit;
}
.friends-search-input:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 2px; }
.friends-action-btn, .friends-refresh-btn {
  border: 1px solid rgba(226,74,87,.45); border-radius: 11px; padding: 10px 14px;
  background: rgba(198,31,44,.16); color: var(--text); font: inherit; font-weight: 800; cursor: pointer;
}
.friends-action-btn:disabled { opacity: .55; cursor: default; }
.friends-status { min-height: 1.2em; margin: 8px 0; color: var(--muted); font-size: .86rem; }
.friends-status.is-error { color: #e66b75; }
.friends-search-results { display: grid; gap: 6px; margin-bottom: 20px; }
.friends-search-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); }
.friends-result-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends-add-btn { flex: none; padding: 7px 12px; font-size: .85rem; }
.friends-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.friends-list-head h4 { margin: 0; }
.friends-refresh-btn { padding: 6px 10px; font-size: .82rem; }
.friends-leaderboard-list { display: grid; gap: 6px; }
.friends-leaderboard-name { min-width: 0; text-align: left; }
.friends-leaderboard-row .leaderboard-score { white-space: nowrap; }
body[data-theme="light"] .friends-panel { border-color: rgba(92,10,18,.12); background: rgba(181,19,34,.035); }
body[data-theme="light"] .friends-search-input { border-color: rgba(0,0,0,.14); background: rgba(255,255,255,.8); color: #231f20; }
body[data-theme="light"] .friends-search-result { background: rgba(181,19,34,.045); }
@media (max-width: 520px) {
  .friends-panel { padding: 14px; }
  .friends-search-line { flex-direction: column; }
  .friends-search-line .friends-action-btn { width: 100%; }
}


/* Sélecteur de vues de la section Five */
.five-view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.five-view-switch button {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.five-view-switch button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.five-view-switch button.active {
  border-color: rgba(226, 74, 87, 0.35);
  background: linear-gradient(135deg, rgba(198, 31, 44, 0.3), rgba(226, 74, 87, 0.14));
  color: var(--text);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
}

.five-subview-hidden {
  display: none !important;
}

body[data-theme="light"] .five-view-switch {
  border-color: rgba(92, 10, 18, 0.12);
  background: rgba(181, 19, 34, 0.045);
}

body[data-theme="light"] .five-view-switch button:hover {
  background: rgba(181, 19, 34, 0.07);
}

body[data-theme="light"] .five-view-switch button.active {
  border-color: rgba(181, 19, 34, 0.2);
  background: rgba(181, 19, 34, 0.1);
  color: var(--text);
}

@media (max-width: 420px) {
  .five-view-switch {
    gap: 4px;
    padding: 5px;
  }

  .five-view-switch button {
    padding: 10px 4px;
    font-size: 0.82rem;
  }
}


/* Profil utilisateur */
.profile-pseudo-form { display: grid; gap: 9px; margin-bottom: 24px; }
.profile-pseudo-form label { color: var(--muted); font-size: .9rem; font-weight: 800; }
.profile-pseudo-line { display: flex; gap: 10px; align-items: stretch; }
.profile-pseudo-line input { flex: 1; min-width: 0; padding: 13px 15px; border: 1px solid var(--panel-border); border-radius: 14px; background: rgba(255,255,255,.05); color: var(--text); font: inherit; }
.profile-status { min-height: 1.2em; margin: 0; color: var(--muted); font-size: .88rem; }
.profile-status.is-error { color: var(--danger); }
.profile-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.profile-stat { min-width: 0; padding: 20px 14px; border: 1px solid rgba(198,31,44,.22); border-radius: 18px; background: rgba(198,31,44,.07); }
.profile-stat span { display: block; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; overflow-wrap: anywhere; }
.profile-stat small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
body[data-theme="light"] .profile-pseudo-line input { background: rgba(255,255,255,.9); color: var(--text); border-color: rgba(92,10,18,.16); }
@media (max-width: 560px) { .profile-stats-grid { grid-template-columns: 1fr; } .profile-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .profile-stat small { margin: 0; text-align: right; } .profile-pseudo-line { flex-direction: column; } }


/* Alerte de pseudo non unique au démarrage */
.duplicate-pseudo-modal-backdrop { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 12, .78); backdrop-filter: blur(8px); }
.duplicate-pseudo-modal-backdrop.hidden { display: none; }
.duplicate-pseudo-modal { width: min(100%, 480px); padding: clamp(24px, 5vw, 36px); border: 1px solid var(--panel-border); border-radius: 24px; background: var(--panel, #17171d); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.duplicate-pseudo-modal h2 { margin: 10px 0 12px; font-size: clamp(1.45rem, 4vw, 1.9rem); }
.duplicate-pseudo-modal p { margin: 0 0 22px; color: var(--muted); line-height: 1.65; }
.duplicate-pseudo-modal-action { width: 100%; }
body[data-theme="light"] .duplicate-pseudo-modal { background: #fff; }


/* Compte et synchronisation de Roazhon Cards */
.account-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(5, 3, 4, .84);
  backdrop-filter: blur(10px);
}
.account-modal-backdrop.hidden { display: none !important; }
.account-modal {
  width: min(100%, 520px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel, #17171d);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.account-modal h2 { margin: 10px 0 12px; font-size: clamp(1.5rem, 4vw, 2rem); }
.account-modal p { color: var(--muted); line-height: 1.6; }
.account-form { display: grid; gap: 10px; margin-top: 18px; }
.account-form label { margin-top: 4px; font-size: .9rem; font-weight: 700; }
.account-form input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}
.account-form button { width: 100%; margin-top: 8px; }
.account-switch-btn { width: 100%; margin-top: 12px; }
.account-modal [hidden] { display: none !important; }
.account-modal .profile-status { margin-top: 14px; overflow-wrap: anywhere; }
.account-modal .profile-status.is-error { color: var(--danger); }
body.account-modal-open { overflow: hidden; }

/* Gestion du compte depuis l’onglet Profil */
.profile-account-box { display: grid; gap: 14px; margin: 0 0 24px; padding: 18px; border: 1px solid var(--panel-border); border-radius: 18px; background: rgba(255,255,255,.025); }
.profile-account-email { display: grid; gap: 5px; min-width: 0; }
.profile-account-email span, .profile-account-form label { color: var(--muted); font-size: .9rem; font-weight: 800; }
.profile-account-email strong { overflow-wrap: anywhere; }
.profile-account-form { display: grid; gap: 9px; }
.profile-account-form h3 { margin: 4px 0; font-size: 1.05rem; }
.profile-account-form input { width: 100%; min-width: 0; padding: 13px 15px; border: 1px solid var(--panel-border); border-radius: 14px; background: var(--bg-soft); color: var(--text); font: inherit; }
.profile-account-form button, .profile-signout-btn { justify-self: start; }
.profile-signout-btn { margin-top: 4px; }

/* Popups de modification des informations du compte */
.profile-account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-account-actions button { flex: 1 1 190px; }
.profile-account-modal-backdrop { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 18px; overflow-y: auto; background: rgba(5, 3, 4, .82); backdrop-filter: blur(8px); }
.profile-account-modal-backdrop.hidden { display: none !important; }
.profile-account-modal { position: relative; width: min(100%, 460px); max-height: calc(100dvh - 36px); overflow-y: auto; padding: clamp(24px, 5vw, 34px); border: 1px solid var(--panel-border); border-radius: 22px; background: var(--panel, #17171d); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.profile-account-modal h2 { margin: 4px 36px 20px 0; font-size: clamp(1.35rem, 4vw, 1.75rem); }
.profile-account-modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text); font-size: 1.7rem; cursor: pointer; }
.profile-account-modal .profile-account-form[hidden] { display: none !important; }
.profile-account-modal .profile-account-form { display: grid; gap: 10px; }
.profile-account-modal .profile-account-form label { margin-top: 4px; color: var(--muted); font-size: .9rem; font-weight: 800; }
.profile-account-modal .profile-account-form input { width: 100%; min-width: 0; padding: 13px 15px; border: 1px solid var(--panel-border); border-radius: 14px; background: var(--bg-soft); color: var(--text); font: inherit; }
.profile-account-modal .profile-account-form button { margin-top: 6px; }
.profile-account-modal .profile-status { overflow-wrap: anywhere; }
body.profile-account-modal-open { overflow: hidden; }
body[data-theme="light"] .profile-account-modal { background: #fff; }

/* Profil — présentation restructurée */
.profile-panel { overflow: hidden; }
.profile-heading { margin-bottom: 22px; }
.profile-overview-card { display:flex; align-items:center; gap:16px; padding:22px; margin-bottom:18px; border:1px solid rgba(198,31,44,.3); border-radius:22px; background:linear-gradient(115deg, rgba(198,31,44,.15), rgba(255,255,255,.025) 70%); }
.profile-avatar { width:58px; height:58px; flex:0 0 58px; display:grid; place-items:center; border-radius:18px; background:linear-gradient(145deg,#d32a3a,#75121d); color:#fff; font-size:1.2rem; font-weight:900; letter-spacing:-.04em; box-shadow:0 8px 24px rgba(198,31,44,.25); }
.profile-overview-copy { min-width:0; display:grid; gap:4px; flex:1; }
.profile-overline,.profile-section-kicker { color:var(--muted); font-size:.7rem; font-weight:900; letter-spacing:.13em; }
.profile-overview-copy strong { font-size:1.25rem; overflow-wrap:anywhere; }
.profile-overview-copy > span:last-child { color:var(--muted); font-size:.9rem; overflow-wrap:anywhere; }
.profile-content-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:18px; align-items:stretch; }
.profile-section-card { min-width:0; padding:22px; border:1px solid var(--panel-border); border-radius:20px; background:rgba(255,255,255,.025); }
.profile-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.profile-section-title h3 { margin:4px 0 0; font-size:1.15rem; }
.profile-section-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:rgba(198,31,44,.1); color:var(--text); font-size:1.2rem; }
.profile-section-description { margin:0 0 18px; color:var(--muted); font-size:.9rem; line-height:1.55; }
.profile-pseudo-form { margin:0; }
.profile-pseudo-form label { color:var(--muted); font-size:.86rem; font-weight:800; }
.profile-pseudo-line { display:flex; gap:9px; align-items:stretch; }
.profile-pseudo-line input { min-width:0; width:100%; padding:12px 13px; border:1px solid var(--panel-border); border-radius:12px; background:var(--bg-soft); color:var(--text); font:inherit; }
.profile-pseudo-line button { flex:0 0 auto; }
.profile-account-box { margin:0; padding:0; border:0; background:transparent; }
.profile-account-email { padding:13px 14px; border:1px solid var(--panel-border); border-radius:13px; background:rgba(255,255,255,.025); }
.profile-account-email strong { font-size:.95rem; }
.profile-account-actions { display:grid; grid-template-columns:1fr; gap:9px; }
.profile-account-actions button { width:100%; min-height:43px; text-align:left; }
.profile-signout-btn { width:100%; justify-self:stretch !important; min-height:43px; margin-top:12px; border-color:rgba(198,31,44,.28); }
.profile-stats-card { margin-top:0; }
.profile-stats-grid { margin-top:16px; }
.profile-stat { background:rgba(198,31,44,.055); }
body[data-theme="light"] .profile-overview-card { background:linear-gradient(115deg,rgba(198,31,44,.09),rgba(255,255,255,.8) 70%); }
body[data-theme="light"] .profile-section-card { background:rgba(255,255,255,.7); }
body[data-theme="light"] .profile-account-email { background:rgba(255,255,255,.8); }
@media(max-width:700px) { .profile-content-grid { grid-template-columns:1fr; } }
@media(max-width:480px) { .profile-overview-card { align-items:flex-start; flex-wrap:wrap; padding:17px; gap:12px; } .profile-avatar { width:48px; height:48px; flex-basis:48px; border-radius:15px; } .profile-overview-copy { width:calc(100% - 65px); } .profile-section-card { padding:17px; } .profile-pseudo-line { flex-direction:column; } .profile-pseudo-line button { width:100%; } }
