/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #222020;
  --surface:   #FFFFFF;
  --border:    #E4E2DC;
  --border2:   #4818cc;
  --text:      #1A1917;
  --text-2:    #6B6860;
  --text-3:    #A8A69E;
  --accent:    #C89B3C;
  --accent-bg: #FBF5E8;
  --blue:      #2D6BE4;
  --blue-bg:   #EEF3FD;
  --red:       #D94040;
  --red-bg:    #FDEAEA;
  --green:     #2A8A4A;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 16px;
}

.header-left  { display: flex; align-items: center; gap: 0; overflow: hidden; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.logo {
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-right: 20px;
  flex-shrink: 0;
}
.logo-dot { color: var(--accent); }

/* ── TABS ── */
.page-tabs {
  display: flex;
  align-items: stretch;
  height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  padding: 0 16px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  height: 100%;
  display: flex;
  align-items: center;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.tab-add {
  font-size: 18px;
  line-height: 1;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  height: 52px;
  transition: color 0.15s;
}
.tab-add:hover { color: var(--text); }

/* ── BUTTONS ── */
.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--text);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.8; }

.btn-ghost {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border2);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); }

.btn-inline {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.btn-inline:hover { color: var(--red); background: var(--red-bg); }

.btn-add-row {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  width: 100%;
  text-align: left;
}
.btn-add-row::before { content: '+'; font-size: 14px; }
.btn-add-row:hover { color: var(--accent); }

/* ── MAIN ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}



.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label .add-section-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--border2);
  padding: 3px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
  transition: color 0.15s, border-color 0.15s;
}
.section-label .add-section-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── CHAMPION BANNER ── */
.champ-banner {
  position: relative;
  height: 90px;
  background-size: 130%;
  background-position: center 15%;
  background-color: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.champ-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 10px;
}

.champ-banner-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  outline: none;
  cursor: text;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
}
.champ-banner-name:focus { color: #FFE8A0; }
.champ-banner-name:empty::before { content: attr(data-placeholder); color: rgba(255,255,255,0.4); }

.champ-banner-del {
  font-size: 16px;
  line-height: 1;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.card:hover .champ-banner-del { opacity: 1; }
.champ-banner-del:hover { color: #ff6b6b; }

/* ── CARD GRID ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border2); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  background: transparent;
  border: none;
  flex: 1;
  cursor: text;
  font-family: 'DM Sans', sans-serif;
}
.card-title:focus { color: var(--accent); }
.card-title:empty::before { content: attr(data-placeholder); color: var(--text-3); }

.card-body {
  padding: 10px 12px 10px;
}

/* ── ITEM ROWS ── */
.item-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
}
.item-bullet {
  color: var(--text-3);
  font-size: 12px;
  flex-shrink: 0;
  user-select: none;
}
.item-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  cursor: text;
}
.item-text:focus { color: var(--text); }
.item-text:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.item-del {
  opacity: 0;
  font-size: 13px;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.1s, color 0.1s;
  flex-shrink: 0;
}
.item-row:hover .item-del { opacity: 1; }
.item-del:hover { color: var(--red); }

/* ── MATCHUP GRID ── */
.matchup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.matchup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.15s;
}
.matchup-card:hover { border-color: var(--border2); }

.matchup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.matchup-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--blue-bg);
  border-radius: 4px;
  padding: 2px 8px;
  outline: none;
  border: none;
  cursor: text;
}
.matchup-tag:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.matchup-body { padding: 10px 12px 10px; }

/* ── BOTTOM ROW ── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── TODO ── */
.todo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head-label {
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.todo-body { padding: 8px 12px 12px; }

.todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.todo-row:last-of-type { border-bottom: none; }

.todo-check {
  width: 15px; height: 15px;
  border: 1.5px solid var(--border2);
  border-radius: 3px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.todo-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.todo-check:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 1px;
  width: 5px; height: 8px;
  border: 1.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.todo-label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: 'DM Sans', sans-serif;
  cursor: text;
  transition: color 0.15s;
}
.todo-row.done .todo-label { color: var(--text-3); text-decoration: line-through; }
.todo-label:empty::before { content: 'Objectif...'; color: var(--text-3); }

/* ── NOTES ── */
.notes-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notes-textarea {
  width: 100%;
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.8;
  min-height: 120px;
}
.notes-textarea::placeholder { color: var(--text-3); }

/* ── SAVE INDICATOR ── */
.save-indicator {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  transition: color 0.3s;
}
.save-indicator.saved { color: var(--green); }

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 24px;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.modal-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .bottom-row { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 60px; }
  .header { padding: 0 16px; }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.page-enter { animation: fadeUp 0.2s ease; }
