/* ==========================================================
   AC News — design lisible
   Palette : noir charbon + or templier discret + accent rouge
   Cinzel uniquement pour le logo, Inter partout ailleurs
   ========================================================== */

:root {
  --bg:           #0e0a09;
  --bg-elev:      #1a1411;
  --bg-card:      #1f1815;
  --bg-card-h:    #281f1a;
  --border:       #3a2d25;
  --border-soft:  #2a201a;
  --text:         #f3ecdd;            /* clair, contrast élevé */
  --text-dim:     #c8baa4;
  --text-muted:   #8d806d;
  --accent:       #d4af5f;            /* or templier */
  --accent-hi:    #f0cb73;
  --danger:       #b9263b;
  --green:        #4ea65a;
  --purple:       #8a6cb6;
  --blue:         #5097c4;
  --shadow:       0 4px 16px rgba(0, 0, 0, .5);
  --bg-grain:
    radial-gradient(1100px 500px at 0% -10%, rgba(185, 38, 59, .10), transparent 60%),
    radial-gradient(900px 400px at 110% 110%, rgba(212, 175, 95, .07), transparent 60%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  /* En shorthand `background:` multi-layer, la couleur n'est lue que dans
     le dernier layer — comme nos gradients sont transparents, on doit poser
     background-color séparément, sinon le viewport reste blanc. */
  background-color: var(--bg);
  background-image: var(--bg-grain);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.muted { color: var(--text-muted); }

/* ============================ Header ============================ */

.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.85rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(14,10,9,.96), rgba(14,10,9,.88)),
    linear-gradient(90deg, rgba(185,38,59,.18), transparent 60%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}

.brand { display: flex; align-items: center; gap: 0.85rem; }
.logo {
  width: 40px; height: 40px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(212,175,95,.35));
}
.brand-text h1 {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.3rem;
  letter-spacing: .14em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-hi);
}
.brand-text small {
  display: block;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-actions { display: flex; align-items: center; gap: .55rem; }
.header-actions input[type="search"] {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .55rem .85rem;
  border-radius: 4px;
  width: 280px;
  outline: none;
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
}
.header-actions input[type="search"]::placeholder { color: var(--text-muted); }
.header-actions input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,175,95,.2);
}
#refresh, .rss-link {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 4px;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  transition: all .15s ease;
}
#refresh:hover, .rss-link:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent-hi);
  text-decoration: none;
}
#refresh .icon { display: inline-block; line-height: 1; }
#refresh.spinning .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ Layout ============================ */

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.25rem;
  gap: 1.5rem;
}

.sidebar {
  position: sticky; top: 80px;
  align-self: start;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: .25rem;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar h2 {
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-dim);
  margin: 1.4rem 0 .55rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: baseline;
}
.sidebar h2:first-child { margin-top: 0; }

.cat-list, .games-list { list-style: none; padding: 0; margin: 0; }
.cat-list li, .games-list li { margin: 2px 0; }

.cat-btn, .game-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: .55rem .65rem;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 500;
  display: flex; align-items: center;
  gap: .55rem;
  transition: background .15s, border-color .15s, color .15s;
  position: relative;
  font-family: inherit;
}
.cat-btn:hover, .game-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-soft);
  color: var(--text);
}
.cat-btn.active, .game-btn.active {
  background: linear-gradient(90deg, rgba(185,38,59,.2), rgba(212,175,95,.06));
  border-color: rgba(185,38,59,.5);
  color: var(--accent-hi);
}
.cat-btn.active::before, .game-btn.active::before {
  content: '';
  position: absolute; left: -1px; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.cat-btn .label { flex: 1; }

.game-btn .game-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-btn .badge, .cat-btn .badge {
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .72rem;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 26px; text-align: center;
}
.cat-btn.active .badge, .game-btn.active .badge {
  background: rgba(212,175,95,.15);
  color: var(--accent-hi);
  border-color: rgba(212,175,95,.35);
}
.game-btn .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.game-btn[data-status="released"]  .status-dot { background: var(--green); }
.game-btn[data-status="upcoming"]  .status-dot { background: var(--accent); }
.game-btn[data-status="rumored"]   .status-dot { background: var(--purple); }
.game-btn[data-status="platform"]  .status-dot { background: var(--blue); }
.game-btn[data-status="unknown"]   .status-dot { background: var(--danger); }

.meta-block {
  margin-top: 1.5rem;
  padding: .8rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
}
.meta-status {
  margin: 0;
  font-size: .8rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.meta-status strong { color: var(--accent); }

/* ============================ Feed ============================ */

/* ============================ Games strip ============================ */

.games-strip {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.games-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .65rem;
}
.games-strip-head h2 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-dim);
}
.games-strip-head .hint {
  font-size: .72rem;
  letter-spacing: .05em;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .65rem;
}

.game-card {
  position: relative;
  display: block;
  height: 95px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
  text-align: left;
  font-family: inherit;
  color: inherit;
  padding: 0;
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}
.game-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,175,95,.45), 0 6px 16px rgba(0,0,0,.5);
}
.game-card .gc-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(.9) contrast(1.05);
}
.game-card.no-cover .gc-bg {
  background:
    radial-gradient(circle at 30% 30%, rgba(212,175,95,.18), transparent 70%),
    linear-gradient(135deg, var(--gc-color, #2a201a), #14100d);
}
.game-card .gc-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.92) 100%);
}
.game-card .gc-status-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--text-muted);
}
.game-card[data-status="released"]  .gc-status-bar { background: var(--green); }
.game-card[data-status="upcoming"]  .gc-status-bar { background: var(--accent); }
.game-card[data-status="rumored"]   .gc-status-bar { background: var(--purple); }
.game-card[data-status="platform"]  .gc-status-bar { background: var(--blue); }
.game-card[data-status="unknown"]   .gc-status-bar { background: var(--danger); }

.game-card .gc-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .5rem .65rem;
  display: flex; flex-direction: column;
  gap: 2px;
}
.game-card .gc-name {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.85);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card .gc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .68rem;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.game-card .gc-meta .gc-status {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.game-card .gc-meta .gc-count {
  background: rgba(0,0,0,.6);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--accent-hi);
}
.game-card.auto-discovered::after {
  content: 'AUTO';
  position: absolute; top: 6px; right: 6px;
  background: var(--danger);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 1px 5px;
  border-radius: 2px;
}

@media (max-width: 700px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
  .game-card { height: 78px; }
  .game-card .gc-name { font-size: .72rem; }
}

.feed-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 .25rem .9rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
  gap: 1rem;
}
.result-info {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}
.feed-actions { display: flex; align-items: center; gap: .5rem; }
.sort-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: .55rem;
}
.sort-label select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-elev);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23d4af5f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: 10px 6px;
  border: 1px solid var(--border);
  color: var(--text);
  padding: .45rem 1.85rem .45rem .75rem;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.sort-label select:hover {
  border-color: var(--accent);
  background-color: var(--bg-card);
}
.sort-label select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,175,95,.2);
}
.sort-label select option {
  background-color: var(--bg-elev);
  color: var(--text);
}

.articles {
  display: grid;
  gap: .75rem;
}
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 1rem;
  font-style: italic;
}

article.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid transparent;
  padding: .9rem 1rem;
  border-radius: 4px;
  transition: background .15s, border-color .15s, transform .15s;
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem;
}
article.card.has-thumb {
  grid-template-columns: 168px 1fr;
  gap: 1rem;
  align-items: start;
}
article.card:hover {
  background: var(--bg-card-h);
  border-left-color: var(--accent);
}

article.card .thumb {
  position: relative;
  width: 168px; height: 95px;
  border-radius: 3px;
  overflow: hidden;
  background: #000;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}
article.card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
article.card:hover .thumb img { transform: scale(1.05); }
article.card .thumb .play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.18);
  color: #fff;
  font-size: 1.6rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  pointer-events: none;
}
article.card .thumb .badge-short {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
article.card .thumb .duration-hint {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
}

article.card .body { min-width: 0; }

article.card h3 {
  margin: 0 0 .3rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.35;
}
article.card h3 a {
  color: var(--text);
}
article.card h3 a:hover {
  color: var(--accent-hi);
  text-decoration: none;
}

article.card .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .76rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
article.card .meta .source {
  color: var(--accent);
  font-weight: 600;
}
article.card .meta .dot { opacity: .5; }
article.card .meta .game-tag {
  background: rgba(212,175,95,.08);
  color: var(--accent);
  border: 1px solid rgba(212,175,95,.3);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
article.card .meta .game-tag:hover {
  background: rgba(212,175,95,.18);
  color: var(--accent-hi);
}
article.card .meta .game-tag.upcoming { color: var(--accent-hi); border-color: var(--accent); }
article.card .meta .game-tag.released { color: #6dc97a; border-color: rgba(78,166,90,.45); background: rgba(78,166,90,.08); }
article.card .meta .game-tag.rumored  { color: #b699d9; border-color: rgba(138,108,182,.45); background: rgba(138,108,182,.08); }
article.card .meta .game-tag.platform { color: #7bb3d6; border-color: rgba(80,151,196,.45); background: rgba(80,151,196,.08); }
article.card .meta .game-tag.unknown  { color: #e89aa1; border-color: rgba(185,38,59,.5); background: rgba(185,38,59,.1); }
article.card .meta .video-tag {
  background: rgba(255,0,0,.12);
  color: #ff6f6f;
  border: 1px solid rgba(255,0,0,.4);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
}

article.card p {
  margin: 0;
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loadmore-wrap {
  text-align: center;
  margin: 2rem 0;
}
#loadmore {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: .65rem 1.6rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .03em;
  font-size: .88rem;
  transition: all .15s;
}
#loadmore:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ============================ Footer ============================ */

.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-soft);
  margin-top: 2rem;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap; gap: .5rem;
}

/* ============================ Tablette ============================ */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding: .85rem;
    gap: 1rem;
  }
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    padding-right: 0;
  }
  /* Sidebar en topbar horizontale : catégories scrollables */
  .sidebar h2 { margin-top: .8rem; }
  .sidebar h2:first-child { margin-top: 0; }
  .cat-list {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .35rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .cat-list::-webkit-scrollbar { height: 4px; }
  .cat-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .cat-list li { margin: 0; flex-shrink: 0; }
  .cat-btn {
    white-space: nowrap;
    padding: .45rem .75rem;
  }
  .cat-btn .label { flex: 0 0 auto; }
  .meta-block { margin-top: 1rem; }
}

/* ============================ Mobile ============================ */

@media (max-width: 700px) {
  .site-header {
    padding: .6rem .85rem;
    gap: .55rem;
    flex-wrap: nowrap;
  }
  .brand { gap: .55rem; min-width: 0; }
  .logo { width: 32px; height: 32px; flex-shrink: 0; }
  .brand-text h1 {
    font-size: .95rem;
    letter-spacing: .1em;
    white-space: nowrap;
  }
  .brand-text small { display: none; }
  .header-actions {
    gap: .35rem;
    flex: 1;
    justify-content: flex-end;
  }
  .header-actions input[type="search"] {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: 220px;
    padding: .45rem .65rem;
    font-size: .85rem;
  }
  #refresh, .rss-link {
    width: 34px; height: 34px;
    flex-shrink: 0;
  }

  .layout { padding: .65rem .65rem 1rem; gap: .85rem; }

  .games-strip { margin-bottom: .85rem; padding-bottom: .65rem; }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .45rem;
  }
  .game-card { height: 78px; }
  .game-card .gc-name { font-size: .72rem; }
  .game-card .gc-content { padding: .35rem .5rem; }

  .feed-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding: 0 0 .65rem;
  }
  .result-info { font-size: .9rem; }

  /* Articles : layout vertical, thumb full-width */
  article.card.has-thumb {
    grid-template-columns: 1fr;
    gap: .55rem;
    padding: .65rem;
  }
  article.card .thumb {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    aspect-ratio: 16/9;
  }
  article.card h3 { font-size: .95rem; }
  article.card .meta { font-size: .72rem; gap: .35rem; }
  article.card p { font-size: .82rem; }

  .site-footer {
    padding: 1rem;
    font-size: .72rem;
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
}

@media (max-width: 420px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
  }
  .game-card { height: 70px; }
  .header-actions input[type="search"] { font-size: .8rem; }
  .brand-text h1 { font-size: .88rem; }
}
