/* =====================================================================
   GraffHunt — Design System
   Palette : noir / gris / blanc — sobre et moderne
===================================================================== */

/* --- Variables --- */
:root {
  --black:   #111111;
  --gray-900:#222222;
  --gray-700:#444444;
  --gray-500:#888888;
  --gray-300:#cccccc;
  --gray-100:#f4f4f4;
  --white:   #ffffff;
  --accent:  #111111;
  --radius:  6px;
  --max:     960px;
  --gap:     24px;
  --font:    'Inter', system-ui, -apple-system, sans-serif;
  --header-h:64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* --- Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  height: var(--header-h);
}
header .container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  display: block;
  width: 180px;
  aspect-ratio: 16/5;
  background: url('/assets/imgs/graffhunt-logo-bot.webp') left center / contain no-repeat;
  flex-shrink: 0;
}
header nav { margin-left: auto; }
nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
  letter-spacing: .01em;
  transition: color .15s;
}
nav a:hover { color: var(--black); text-decoration: none; }
nav a.active { color: var(--black); font-weight: 700; }
.nav-lang {
  display: flex;
  gap: .5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--gray-300);
}
.nav-lang a, .nav-lang strong {
  font-size: .85rem;
  color: var(--gray-500);
}
.nav-lang strong { color: var(--black); font-weight: 700; }

/* --- Main --- */
main {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem var(--gap) 4rem;
}

/* --- Typography --- */
h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
p  { margin-bottom: .75rem; color: var(--gray-700); }
small { font-size: .82rem; color: var(--gray-500); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  letter-spacing: .01em;
}
.btn:hover { background: var(--gray-100); text-decoration: none; }
.btn.primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn.primary:hover { background: var(--gray-900); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* --- Cards (home modes) --- */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin: 2rem 0;
}
.mode-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}
.mode-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.mode-card-icon {
  background: var(--gray-100);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.mode-card-body { padding: 1.25rem; flex: 1; }
.mode-card-body h3 { margin-bottom: .4rem; font-size: 1.05rem; }
.mode-card-body p  { font-size: .88rem; margin: 0; color: var(--gray-500); }

/* --- Stats bar --- */
.stats-bar {
  display: flex;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--gray-300);
  border-bottom: 1px solid var(--gray-300);
  margin: 2rem 0;
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: .1rem; }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: .8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; }

/* --- App layout (play/quiz) --- */
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 768px) { .app { grid-template-columns: 1fr; } }
.panel { background: var(--white); }

#streetimg { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); background: var(--gray-100); }
#map       { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); }

/* --- Bottom panel --- */
#bottom-panel { margin-top: var(--gap); }

/* --- Rows --- */
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }

/* --- Score --- */
.scorebox { text-align: right; }
.scorebox strong { font-size: 1.1rem; }

/* --- Feedback --- */
.feedback { margin-top: .75rem; font-weight: 700; font-size: 1rem; }
.feedback small { font-weight: 500; color: var(--gray-500); }
.feedback.correct { color: #16a34a; }
.feedback.wrong   { color: #dc2626; }

/* --- Progress bar --- */
.progress-wrap {
  display: none;
  width: 100%;
  height: 4px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
  margin: .75rem 0;
}
.progress-bar { width: 0%; height: 100%; background: var(--black); transition: width 100ms linear; }

/* --- End screen --- */
.end-screen { text-align: center; margin-top: 2rem; display: none; }
.next-info  { font-weight: 600; display: none; margin: .5rem 0; font-size: .9rem; color: var(--gray-500); }
.error      { color: #dc2626; font-weight: 600; display: none; margin-top: 1rem; }
.muted      { color: var(--gray-500); font-size: .9rem; }

/* --- History table --- */
.history { margin-top: 1.5rem; overflow-x: auto; }
.history table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history th { font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; color: var(--gray-500); border-bottom: 2px solid var(--gray-300); padding: .5rem .75rem; }
.history td { padding: .5rem .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.history img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; }

.pill  { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--gray-100); font-weight: 600; font-size: .82rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--gray-100); font-weight: 700; font-size: .82rem; color: var(--gray-700); }

/* --- Cities / Artists grid --- */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.grid-list a {
  display: block;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
}
.grid-list a:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.grid-list img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--gray-100); }
.grid-list span { display: block; padding: .5rem .75rem; font-size: .88rem; font-weight: 600; }

/* Cities list (texte) */
.city-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.city-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-weight: 500;
  transition: background .15s;
}
.city-list a:hover { background: var(--gray-100); text-decoration: none; }

/* --- Table générique --- */
table { width: 100%; border-collapse: collapse; }
th { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); border-bottom: 2px solid var(--gray-300); padding: .6rem .75rem; text-align: left; }
td { padding: .6rem .75rem; border-bottom: 1px solid var(--gray-100); font-size: .92rem; }

/* --- Contact form --- */
.form-container { max-width: 560px; }
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .form-row { flex-direction: column; } }
.form-group { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
label { font-size: .85rem; font-weight: 600; color: var(--gray-700); }
input, textarea {
  padding: .6rem .75rem;
  font-size: .95rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  width: 100%;
  font-family: var(--font);
  transition: border-color .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--black); }
textarea { resize: vertical; min-height: 120px; }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--gray-300);
  padding: 1.5rem var(--gap);
  text-align: center;
  font-size: .82rem;
  color: var(--gray-500);
}
footer a { color: var(--gray-500); }
footer a:hover { color: var(--black); }
footer .heart { color: #e11d48; }
footer nav ul { justify-content: center; gap: 1.5rem; margin-bottom: .75rem; }
footer nav a { font-size: .82rem; color: var(--gray-500); }

/* --- Quiz mode --- */
#quiz-app { display: flex; flex-wrap: wrap; gap: var(--gap); }
#quiz-image-panel { flex: 1 1 420px; }
#quiz-image-panel img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background: var(--gray-100); }
#quiz-right-panel { flex: 1 1 300px; display: flex; flex-direction: column; gap: .75rem; }
#quiz-choices { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.choice-btn {
  width: 100%;
  text-align: left;
  padding: .7rem 1rem;
  font-size: .95rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.choice-btn:hover:not(:disabled) { background: var(--gray-100); }
.choice-btn.correct { background: #f0fdf4; border-color: #16a34a; color: #16a34a; font-weight: 700; }
.choice-btn.wrong   { background: #fef2f2; border-color: #dc2626; color: #dc2626; font-weight: 700; }
.choice-btn:disabled { cursor: default; }

/* --- Explore mode --- */
#explore-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h) - 5rem);
  min-height: 400px;
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-300);
}
#explore-map { flex: 1; height: 100%; z-index: 1; }

.explore-panel {
  display: none;
  flex-direction: column;
  width: 320px;
  min-width: 260px;
  background: var(--white);
  border-left: 1px solid var(--gray-300);
  overflow-y: auto;
  z-index: 10;
}
.explore-panel img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--gray-100); }
#explore-info { padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.explore-artiste { font-weight: 800; font-size: 1.05rem; }
.explore-close {
  position: absolute;
  top: .6rem;
  right: .6rem;
  background: rgba(0,0,0,.55);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  #explore-wrap { height: calc(100vh - var(--header-h) - 2rem); border-radius: 0; border-left: none; border-right: none; }
  .explore-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    max-height: 55%;
    border-left: none;
    border-top: 1px solid var(--gray-300);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    z-index: 500;
  }
}

/* --- Misc --- */
.legend { font-size: .78rem; color: var(--gray-500); text-align: right; margin-top: .25rem; }
.intro  { max-width: 640px; }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .mode-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 1rem; }
}
