/* =========================
   Bars 2 Rouen — CSS
   Replacement for assets/styles.css
   ========================= */

:root {
  --bg: #0b0f1a;
  --panel: rgba(255, 255, 255, .06);
  --panel-2: rgba(255, 255, 255, .085);
  --border: rgba(255, 255, 255, .12);

  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .70);
  --faint: rgba(255, 255, 255, .55);

  --accent: #7c5cff;
  --accent-2: #00d4ff;

  --shadow: 0 18px 60px rgba(0, 0, 0, .45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .25);

  --radius: 16px;
  --radius-sm: 12px;

  --max: 1040px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --panel: rgba(0, 0, 0, .04);
    --panel-2: rgba(0, 0, 0, .06);
    --border: rgba(0, 0, 0, .10);
    --text: rgba(0, 0, 0, .88);
    --muted: rgba(0, 0, 0, .62);
    --faint: rgba(0, 0, 0, .52);
    --shadow: 0 18px 60px rgba(17, 24, 39, .14);
    --shadow-soft: 0 10px 30px rgba(17, 24, 39, .10);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 18px 40px;
  min-height: 85vh;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(10, 14, 25, .78), rgba(10, 14, 25, .35));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}

.brand {
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav a {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
}

.nav a:hover {
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

/* Controls */
.controls {
  display: flex;
  gap: 12px;
  margin: 16px 0 18px;
  align-items: center;
}

.search,
.sort {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  box-shadow: var(--shadow-soft);
}

.search {
  flex: 1;
  min-width: 180px;
}

.search::placeholder {
  color: var(--faint);
}

.sort {
  min-width: 170px;
  cursor: pointer;
}

option {
  color: black;
}

/* Cards */
.list {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 12;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), transparent 120%);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(550px 180px at 10% 0%, rgba(124, 92, 255, .22), transparent 55%);
  pointer-events: none;
  opacity: .9;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 92, 255, .35);
  background: linear-gradient(180deg, var(--panel-2), transparent 120%);
  text-decoration: none !important;
}

@media (min-width: 860px) {
  .card {
    grid-column: span 6;
  }
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: .1px;
}

.card h2 a:hover {
  text-decoration: none;
  color: var(--accent-2);
}

.score {
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  white-space: nowrap;
}

.meta {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.date {
  padding: 6px 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  font-size: 12px;
  color: var(--text);
}

.verdict {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Bar page */
.bar-page h1 {
  margin: 10px 0 6px;
  font-size: 34px;
  letter-spacing: -0.6px;
  line-height: 1.1;
}

.bar-page section {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), transparent 140%);
  box-shadow: var(--shadow-soft);
}

.bar-page h2 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: .2px;
}

/* Global score (big, centered) */
.global-score-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 10px;
  padding: 18px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 92, 255, .20), rgba(0, 212, 255, .12));
  box-shadow: var(--shadow-soft);
}

.global-score-num {
  font-size: 54px;
  font-weight: 950;
  letter-spacing: -1px;
  line-height: 1;
}

.global-score-den {
  font-size: 18px;
  color: var(--muted);
  font-weight: 800;
}

/* Medals */
.medals ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.medals li {
  margin: 6px 0;
}

.medals li:empty {
  display: none;
}

/* Score tree (global -> categories -> subcategories) */
.score-tree {
  position: relative;
}

.score-tree::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .22), transparent);
  opacity: .55;
}

.cats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
  position: relative;
}

.cats-row::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -10px;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, .22), transparent);
  opacity: .55;
}

.cat {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.cat-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .2px;
}

.cat-score {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 950;
}

.subs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.sub {
  padding: 10px 10px;
  text-align: center;
  min-height: 78px;
}

.sub-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.15;
}

.sub-score {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  font-size: 16px;
  font-weight: 950;
}

@media (max-width: 920px) {

  .cats-row,
  .subs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-tree::before,
  .cats-row::before {
    display: none;
  }
}

@media (max-width: 520px) {

  .cats-row,
  .subs-grid {
    grid-template-columns: 1fr;
  }

  .global-score-num {
    font-size: 46px;
  }
}

/* Admin */
.form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.form input,
.form textarea,
.form button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 12px 12px;
  outline: none;
  box-shadow: var(--shadow-soft);
}

.form textarea {
  min-height: 110px;
  resize: vertical;
}

.form button {
  cursor: pointer;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(124, 92, 255, .85), rgba(0, 212, 255, .55));
  border-color: rgba(255, 255, 255, .18);
}

.form button:hover {
  filter: brightness(1.05);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px 12px;
  align-items: center;
}

.grid input[type="number"] {
  text-align: center;
  font-weight: 800;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.admin-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 10px;
}

.admin-list a {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.admin-list a:hover {
  text-decoration: none;
  border-color: rgba(124, 92, 255, .35);
}

.admin-list form button {
  width: auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.admin-list form button:hover {
  border-color: rgba(255, 80, 80, .55);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px;
  background: rgba(0, 0, 0, .12);
  color: var(--muted);
}

.footer a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
}

.footer a:hover {
  text-decoration: none;
  border-color: rgba(124, 92, 255, .35);
}

/* Error */
.error {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 80, 80, .35);
  background: rgba(255, 80, 80, .08);
  color: rgba(255, 255, 255, .92);
}


/* ===== Rating (5 stars independent, true partial fill) ===== */
.rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 10px;
  padding: 18px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 92, 255, .20), rgba(0, 212, 255, .12));
  box-shadow: var(--shadow-soft);
}

.stars5 {
  --s: 34px;
  --g: 6px;
  display: flex;
  gap: var(--g);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .25));
}

.star {
  width: var(--s);
  height: var(--s);
  position: relative;
  display: inline-block;
}

.star::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' fill-opacity='0.22' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* étoile remplie, coupée par largeur (pas redimensionnée) */
.star::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--fill, 0%);
  overflow: hidden;

  /* IMPORTANT : taille fixe + alignée à gauche */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffd166' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: var(--s) var(--s);
}

.rating-num {
  font-size: 16px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 520px) {
  .stars5 {
    --s: 30px;
    --g: 5px;
  }
}


/* Medal icons on cards */
.medal-tag {
  padding: 4px 5px;
  background: rgb(197 184 21 / 15%);
  border-style: dotted;
  font-size: 18px;
}