:root {
  --v3-lime:#B5FF4D;
  --v3-text:#111111;
  --v3-muted:#777782;
  --v3-bg:#FFFFFF;
  --v3-soft:#F4F4F5;
  --v3-border:#EAEAEA;
}
html,body {
  margin:0;
  background:var(--v3-bg);
  color:var(--v3-text);
  font-family:Inter,Arial,sans-serif;
}
* {box-sizing:border-box}
.v3-header {
  height:68px;
  padding:0 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:var(--v3-bg);
  max-width:1400px;
  margin:auto;
}
.v3-logo img {display:block;width:132px;height:auto}
.v3-header-actions {display:flex;align-items:center;gap:20px}
.v3-search svg {width:23px;height:23px}
.v3-avatar {
  width:35px;height:35px;
  border-radius:50%;
  display:grid;place-items:center;
  background:#E8E8E8;
  color:#111;text-decoration:none;font-weight:700;
}
.v3-signin {color:#111;text-decoration:none;font-size:13px;font-weight:700}
.v3-bottom-nav {
  position:fixed;
  bottom:0;left:50%;
  transform:translateX(-50%);
  width:min(100%,620px);
  height:70px;
  background:var(--v3-bg);
  border-top:1px solid var(--v3-border);
  display:flex;
  justify-content:space-around;
  align-items:center;
  z-index:1000;
  padding-bottom:env(safe-area-inset-bottom);
}
.v3-bottom-nav a {
  display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;
  color:#111;text-decoration:none;
  font-size:10px;font-weight:500;
  min-width:48px;
}
.v3-nav-icon {font-size:23px;line-height:1}
.v3-bottom-nav a.active .v3-nav-icon {color:#83C900}
@media(min-width:900px) {
  .v3-bottom-nav {
    bottom:20px;
    border:1px solid var(--v3-border);
    border-radius:22px;
    box-shadow:0 8px 32px #00000012;
  }
}
@media(max-width:600px) {
  .v3-header {height:60px;padding:0 18px}
  .v3-logo img {width:112px}
  .v3-bottom-nav {height:66px}
}

/* BYLBY 3.0 — navigation SVG */
.v3-nav-icon {
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.v3-nav-icon svg {
  width:23px;
  height:23px;
  display:block;
}
.v3-bottom-nav a.active .v3-nav-icon {
  color:#111;
}
.v3-bottom-nav a.active .v3-nav-icon::after {
  content:"";
  position:absolute;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#B5FF4D;
  bottom:-6px;
  left:50%;
  transform:translateX(-50%);
}
.v3-bottom-nav a.active {
  font-weight:700;
}

/* BYLBY 3.0 — présentation du fil de duels */
.by3-duels {
  max-width:1120px;
  padding-top:8px;
}
.by3-filters {
  display:flex;
  gap:7px;
  overflow-x:auto;
  scrollbar-width:none;
  padding:5px 0 14px;
}
.by3-filters::-webkit-scrollbar {display:none}
.by3-filter {
  border:0;
  border-radius:100px;
  background:#F4F4F5;
  color:#111;
  padding:9px 15px;
  font:600 12px Inter,Arial,sans-serif;
  white-space:nowrap;
  cursor:pointer;
}
.by3-filter.active {
  background:#B5FF4D;
}
.by3-arena {
  gap:7px;
}
.by3-choice {
  border:0;
  border-radius:11px;
  overflow:hidden;
  background:#fff;
}
.by3-image {
  height:clamp(350px,68vh,720px);
  object-fit:cover;
  border-radius:11px;
  background:#F4F4F5;
}
.by3-vs {
  background:#111;
  color:#fff;
  border:2px solid #fff;
}
.by3-info {
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:12px 4px;
}
.by3-info strong {
  font-size:15px;
  font-weight:700;
}
.by3-info small {
  font-size:12px;
  font-weight:400;
  color:#777782;
}
@media(max-width:600px) {
  .by3-duels {padding:0 10px 90px}
  .by3-filters {padding:4px 0 12px}
  .by3-filter {padding:8px 12px;font-size:11px}
  .by3-arena {gap:5px}
  .by3-image {height:clamp(280px,57vh,580px)}
  .by3-info {padding:9px 2px}
  .by3-info strong {font-size:12px}
  .by3-info small {font-size:10px}
}

/* BYLBY 3.0 — cartes de duel et interactions */
.by3-duels .by3-arena {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.by3-duels .by3-creation {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.by3-duels .by3-choice {
  width: 100%;
}

.by3-duels .by3-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 5px;
}

.by3-duels .by3-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #111;
  padding: 6px 3px;
  cursor: pointer;
  font: 500 12px Inter, Arial, sans-serif;
}

.by3-duels .by3-action svg {
  width: 21px;
  height: 21px;
}

.by3-duels .by3-action.is-active {
  color: #75B900;
}

.by3-duels .by3-action:disabled {
  opacity: .5;
  cursor: wait;
}

.by3-duels .by3-vs {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: #B5FF4D;
  color: #111;
  border: 2px solid #fff;
  pointer-events: none;
}

@media (max-width: 600px) {
  .by3-duels .by3-arena {
    gap: 6px;
  }

  .by3-duels .by3-actions {
    padding: 7px 0;
    gap: 2px;
  }

  .by3-duels .by3-action {
    font-size: 10px;
    gap: 2px;
    padding: 5px 1px;
  }

  .by3-duels .by3-action svg {
    width: 18px;
    height: 18px;
  }
}


/* BYLBY 3.0 — interactions minimalistes */
.by3-duels .by3-actions {
  position: relative;
  justify-content: space-between;
  padding: 8px 10px;
}

.by3-duels .by3-action[data-action="like"] {
  gap: 7px;
}

.by3-duels .by3-more {
  border: 0;
  background: transparent;
  color: #111;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  padding: 2px 10px;
  cursor: pointer;
}

.by3-duels .by3-more-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: 100%;
  width: 195px;
  padding: 6px;
  border: 1px solid #e7e7e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.by3-duels .by3-more-menu[hidden] {
  display: none !important;
}

.by3-duels .by3-more-menu button {
  display: block;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #111;
  text-align: left;
  font: 500 13px Inter, Arial, sans-serif;
  cursor: pointer;
}

.by3-duels .by3-more-menu button:hover,
.by3-duels .by3-more-menu button:focus-visible {
  background: #f4f4f5;
}

/* BYLBY V3 — un duel = un écran */

html:has(.by3-duels),
body:has(.by3-duels) {
  height: 100%;
  overflow: hidden;
}

body:has(.by3-duels) {
  min-height: 0;
}

.by3-duels {
  height: calc(100dvh - 105px);
  max-height: calc(100dvh - 105px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.by3-duels .by3-filters {
  flex: 0 0 auto;
}

.by3-duels #by3-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.by3-duels #by3-stage[hidden] {
  display: none;
}

.by3-duels .by3-arena {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.by3-duels .by3-creation {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.by3-duels .by3-choice {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.by3-duels .by3-image {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  width: 100%;
  object-fit: contain;
  background: #f4f4f5;
}

.by3-duels .by3-info {
  flex: 0 0 auto;
}

.by3-duels .by3-actions {
  flex: 0 0 auto;
}

.by3-duels .by3-vs {
  top: 43%;
}

@media (max-width: 600px) {
  .by3-duels {
    height: calc(100dvh - 90px);
    max-height: calc(100dvh - 90px);
  }

  .by3-duels .by3-info {
    padding: 8px 3px;
  }

  .by3-duels .by3-actions {
    padding: 5px 2px;
  }
}

/* BYLBY V3 — cartes immersives, sans défilement */
.by3-duels .by3-arena {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.by3-duels .by3-creation {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #f4f4f5;
}

.by3-duels .by3-choice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
}

.by3-duels .by3-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: transparent;
}

.by3-duels .by3-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.by3-duels .by3-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 0;
  pointer-events: none;
}

.by3-duels .by3-action[data-action="like"],
.by3-duels .by3-more {
  pointer-events: auto;
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: #111;
  box-shadow: 0 3px 14px rgba(0,0,0,.08);
  backdrop-filter: blur(12px);
}

.by3-duels .by3-action[data-action="like"].is-active {
  color: #75B900;
}

.by3-duels .by3-more {
  font-size: 23px;
  line-height: 1;
}

.by3-duels .by3-more-menu {
  position: absolute;
  top: 0;
  right: 52px;
  width: 190px;
  pointer-events: auto;
}

.by3-duels .by3-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 36px 15px 15px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.78),
    rgba(0,0,0,.35) 65%,
    transparent
  );
  pointer-events: none;
}

.by3-duels .by3-info strong,
.by3-duels .by3-info small {
  color: #fff;
}

.by3-duels .by3-vs {
  top: 50%;
}

@media (max-width: 600px) {
  .by3-duels .by3-creation {
    border-radius: 12px;
  }

  .by3-duels .by3-actions {
    top: 7px;
    right: 5px;
    gap: 6px;
  }

  .by3-duels .by3-action[data-action="like"],
  .by3-duels .by3-more {
    min-width: 32px;
    min-height: 32px;
    padding: 5px;
    border-radius: 10px;
  }

  .by3-duels .by3-info {
    padding: 28px 8px 10px;
  }

  .by3-duels .by3-more-menu {
    top: 38px;
    right: 0;
    width: min(180px, 75vw);
  }
}

/* BYLBY V3 — ajustement de l'espace et des commandes */

.by3-duels {
  height: calc(100dvh - 28px) !important;
  max-height: none !important;
  padding-bottom: 88px !important;
  box-sizing: border-box !important;
}

.by3-duels #by3-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.by3-duels .by3-arena,
.by3-duels .by3-creation {
  height: 100% !important;
  min-height: 0 !important;
}

.by3-duels .by3-actions {
  top: 12px !important;
  right: 12px !important;
  gap: 7px !important;
}

.by3-duels .by3-action[data-action="like"],
.by3-duels .by3-more {
  box-sizing: border-box !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 13px !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
}

.by3-duels .by3-action[data-action="like"] svg {
  width: 19px !important;
  height: 19px !important;
}

.by3-duels .by3-more {
  font-size: 25px !important;
  line-height: 1 !important;
}

.by3-duels .by3-more-menu {
  top: 0 !important;
  right: 53px !important;
}

@media (max-width: 600px) {
  .by3-duels {
    height: calc(100dvh - 12px) !important;
    padding-bottom: 78px !important;
  }

  .by3-duels .by3-actions {
    top: 7px !important;
    right: 7px !important;
  }

  .by3-duels .by3-action[data-action="like"],
  .by3-duels .by3-more {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
  }

  .by3-duels .by3-more-menu {
    top: 42px !important;
    right: 0 !important;
  }
}

/* BYLBY V3 — hauteur pilotée par la navigation */
.by3-duels {
  height: var(--by3-available-height, calc(100dvh - 190px)) !important;
  max-height: none !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

.by3-duels #by3-stage,
.by3-duels .by3-arena,
.by3-duels .by3-creation {
  min-height: 0 !important;
}


/* BYLBY V3 — affichage mobile immersif */
@media (max-width: 600px) {
  .by3-duels .by3-creation {
    background: #111;
  }

  .by3-duels .by3-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .by3-duels .by3-info {
    padding: 42px 9px 12px;
    background: linear-gradient(
      to top,
      rgba(0,0,0,.82),
      rgba(0,0,0,.28) 65%,
      transparent
    );
  }

  .by3-duels .by3-vs {
    top: 50%;
  }
}

/* BYLBY V3 — respect intégral des œuvres */
.by3-duels .by3-creation {
  background: #f4f4f5;
}

.by3-duels .by3-image {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
}

@media (max-width: 600px) {
  .by3-duels .by3-image {
    object-fit: contain !important;
  }
}

/* BYLBY V3 — fond artistique immersif */
.by3-duels .by3-creation {
  isolation: isolate;
  background: #242424;
}

.by3-duels .by3-creation::before {
  content: "";
  position: absolute;
  inset: -30px;
  z-index: -1;
  background-image: var(--by3-art-background, none);
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.65);
  transform: scale(1.08);
  pointer-events: none;
}

.by3-duels .by3-choice,
.by3-duels .by3-image {
  background: transparent !important;
}

.by3-duels .by3-image {
  object-fit: contain !important;
}

/* BYLBY — Confirmation visuelle du vote */
.by3-creation.by3-not-chosen .by3-image {
  filter: brightness(.48);
  transition: filter 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .by3-creation.by3-not-chosen .by3-image {
    transition: none;
  }
}

/* BYLBY V3 — profils des auteurs accessibles */
.by3-duels .by3-info .by3-author-link {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    display: inline-block;
    align-self: flex-start;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.by3-duels .by3-info .by3-author-link:hover {
    text-decoration: underline;
}

/* BYLBY V3 — navigation flottante noire */
.v3-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(370px, calc(100% - 32px));
  height: 66px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #111;
  border: 1px solid #292929;
  border-radius: 100px;
  box-shadow: 0 12px 35px rgba(0,0,0,.22);
  z-index: 1000;
}

.v3-bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  min-width: 44px;
  height: 48px;
  color: #fff;
  text-decoration: none;
}

.v3-bottom-nav .v3-nav-icon,
.v3-bottom-nav a.active .v3-nav-icon {
  color: inherit;
}

.v3-bottom-nav .v3-nav-icon::after,
.v3-bottom-nav a.active .v3-nav-icon::after {
  display: none;
}

.v3-bottom-nav a:hover,
.v3-bottom-nav a:focus-visible {
  color: #B5FF4D;
}

.v3-bottom-nav .v3-create {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: #B5FF4D;
  color: #111;
  border-radius: 50%;
}

.v3-bottom-nav .v3-create:hover {
  background: #c9ff7e;
  color: #111;
}

.v3-bottom-nav .v3-create svg {
  width: 27px;
  height: 27px;
}

.v3-nav-profile img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.v3-bottom-nav .v3-message-badge {
  border-color: #111;
}

@media (min-width: 900px) {
  .v3-bottom-nav {
    bottom: 24px;
    border: 1px solid #292929;
    border-radius: 100px;
  }
}

@media (max-width: 600px) {
  .v3-bottom-nav {
    height: 66px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}


/* BYLBY V3 — apparence sombre globale */
:root[data-theme="dark"] {
  --v3-bg: #1B1B1D;
  --v3-text: #FFFFFF;
  --v3-muted: #A1A1AA;
  --v3-soft: #29292C;
  --v3-border: #38383C;
  --by-bg: #1B1B1D;
}

:root[data-theme="dark"],
:root[data-theme="dark"] body {
  background: #1B1B1D;
  color: #FFFFFF;
}

:root[data-theme="dark"] .v3-header,
:root[data-theme="dark"] .v3-bottom-nav {
  background: #1B1B1D;
  color: #FFFFFF;
}

:root[data-theme="dark"] .v3-signin,
:root[data-theme="dark"] .v3-search,
:root[data-theme="dark"] .v3-notification-link,
:root[data-theme="dark"] .v3-bottom-nav a {
  color: #FFFFFF;
}

:root[data-theme="dark"] .by3-filter:not(.active) {
  background: #303033;
  color: #FFFFFF;
}

:root[data-theme="dark"] .by3-filter.active {
  background: #B5FF4D;
  color: #111111;
}

:root[data-theme="dark"] .by3-duels {
  background: #1B1B1D;
}


/* BYLBY V3 — logo adapté au thème */
.v3-logo .v3-logo-dark {
  display: none;
}

:root[data-theme="dark"] .v3-logo .v3-logo-light {
  display: none;
}

:root[data-theme="dark"] .v3-logo .v3-logo-dark {
  display: block;
}


/* BYLBY V3 — finitions du thème sombre */

/* Le fond noir du logo blanc se fond dans l'anthracite */
:root[data-theme="dark"] .v3-logo .v3-logo-dark {
  mix-blend-mode: screen;
}

/* Navigation plus visible sur fond anthracite */
:root[data-theme="dark"] .v3-bottom-nav {
  background: #303033;
  border: 1px solid #505055;
  box-shadow:
    0 10px 35px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(255, 255, 255, .03);
}


/* BYLBY V3 — logos harmonisés */
.v3-logo {
  display: inline-flex;
  align-items: center;
}

.v3-logo img {
  width: auto;
  height: 43px;
  max-width: none;
  mix-blend-mode: normal;
}

@media (max-width: 600px) {
  .v3-logo img {
    height: 36px;
    width: auto;
  }
}


/* BYLBY V3 — logos définitifs identiques */
.v3-logo .v3-logo-light,
.v3-logo .v3-logo-dark {
  width: 132px;
  height: auto;
  max-width: none;
  object-fit: contain;
  mix-blend-mode: normal;
}

@media (max-width: 600px) {
  .v3-logo .v3-logo-light,
  .v3-logo .v3-logo-dark {
    width: 112px;
    height: auto;
  }
}

/* BYLBY V3 — correction définitive des logos */
.v3-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.v3-logo .v3-logo-light,
.v3-logo .v3-logo-dark {
  width: 145px;
  height: auto;
  max-width: none;
  object-fit: contain;
  mix-blend-mode: normal;
}

/* Thème clair */
.v3-logo .v3-logo-light {
  display: block;
}

.v3-logo .v3-logo-dark {
  display: none;
}

/* Thème sombre */
:root[data-theme="dark"] .v3-logo .v3-logo-light {
  display: none;
}

:root[data-theme="dark"] .v3-logo .v3-logo-dark {
  display: block;
  mix-blend-mode: normal;
}

@media (max-width: 600px) {
  .v3-logo .v3-logo-light,
  .v3-logo .v3-logo-dark {
    width: 123px;
    height: auto;
  }
}
