/* === Design System — hadrien-rose.com dark palette === */
@import url('https://api.fontshare.com/v2/css?f[]=clash-grotesk@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Newsreader:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --surface:                  #101010;
  --surface-container-low:    #141414;
  --surface-container:        #1f1f1f;
  --surface-container-high:   #252525;
  --surface-container-highest:#303030;
  --on-surface:               #fdfbf0;
  --on-surface-variant:       #d8d8d0;
  --outline:                  #909090;
  --outline-variant:          #2a2a2a;
  --primary:                  #fdfbf0;
  --on-primary:               #101010;
  --sage:                     #a3c4b4;
  --sage-dark:                #7fae9a;
  --ink-soft:                 #1a2820;
  --ink-muted:                #a3c4b4;
  --sienna:                   #c8956a;
  --sienna-soft:              #2a1a0a;
  --dark-header:              #0a0a0a;
  --dark-nav:                 #111111;
  --dark-border:              #1e1e1e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== HEADER ===== */
header {
  background: var(--dark-header);
  padding: 0 24px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--dark-border);
}

.header-left { /* spacer */ }

.header-title {
  font-family: 'Clash Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-surface);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.header-meta {
  font-size: 11px;
  color: rgba(253, 251, 240, 0.3);
  font-family: 'Clash Grotesk', sans-serif;
  letter-spacing: 0.05em;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(253, 251, 240, 0.9);
  font-weight: 600;
  font-family: 'Clash Grotesk', sans-serif;
}

.header-user-icon {
  opacity: 0.75;
  flex-shrink: 0;
}

.header-user-change {
  font-size: 11px;
  color: rgba(253, 251, 240, 0.3);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.header-user-change:hover { color: rgba(253, 251, 240, 0.7); }

/* ===== TABS ===== */
.tabs-nav {
  background: var(--dark-nav);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 52px;
  z-index: 99;
  padding: 0 24px;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 18px 44px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Clash Grotesk', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253, 251, 240, 0.35);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: rgba(253, 251, 240, 0.7); }
.tab-btn.active {
  color: var(--on-surface);
  border-bottom-color: var(--sage);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CONTAINER ===== */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'Clash Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--on-surface-variant);
  margin-top: 40px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--outline-variant);
}
.section-title:first-child { margin-top: 0; }

/* ===== COMPARISON TABLE ===== */
.table-wrap { overflow-x: auto; margin-bottom: 24px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: var(--surface-container);
  padding: 8px 12px;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--outline);
  border-bottom: 1px solid var(--outline-variant);
  white-space: nowrap;
  font-family: 'Clash Grotesk', sans-serif;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--outline-variant);
  vertical-align: middle;
  color: var(--on-surface);
  font-size: 13px;
}

tr:last-child td { border-bottom: none; }

tr.variant-row td {
  background: var(--surface-container-low);
  color: var(--outline);
}
tr.variant-row td:first-child { padding-left: 24px; }

tr:hover td { background: var(--surface-container-low); }

.not-confirmed { font-size: 10px; color: var(--sienna); }
.skipper-incl  { font-size: 10px; color: var(--sage); }

/* ===== BOAT CARDS — BENTO HORIZONTAL ===== */
.boats-grid {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-bottom: 72px;
}

.boat-card {
  background: var(--surface-container);
  display: grid;
  grid-template-columns: 380px 1fr;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  min-height: 260px;
  opacity: 0;
  transform: translateY(36px) scale(0.98);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s ease,
              box-shadow 0.25s ease;
}
.boat-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.boat-card:hover {
  border-color: var(--outline);
  box-shadow: 0 12px 56px rgba(0,0,0,0.5);
}

/* Photo carousel */
.photo-carousel {
  position: relative;
  background: var(--surface-container-highest);
  overflow: hidden;
  height: 100%;
  min-height: 260px;
}

.photo-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.photo-carousel img.active { display: block; }

.photo-nav {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.photo-dot {
  width: 5px;
  height: 5px;
  background: rgba(253,251,240,0.35);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}
.photo-dot.active { background: var(--on-surface); }

.photo-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: var(--on-surface);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.photo-btn:hover { opacity: 1; }
.photo-btn.prev { left: 0; }
.photo-btn.next { right: 0; }

.no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--outline-variant);
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  background: var(--surface-container);
}

/* Card body */
.boat-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.boat-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.boat-name {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--on-surface);
}

.boat-model {
  font-size: 13px;
  color: var(--on-surface-variant);
}

.boat-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.boat-spec { display: flex; align-items: center; gap: 4px; }

.boat-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--outline-variant);
}

.boat-price-day {
  font-size: 22px;
  font-weight: 700;
  color: var(--on-surface);
  font-family: 'Clash Grotesk', sans-serif;
}

.boat-price-perday {
  font-size: 13px;
  font-weight: 400;
  color: var(--outline);
  margin-left: 2px;
}

.boat-skipper-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--on-surface);
  margin-left: auto;
  font-family: 'Clash Grotesk', sans-serif;
}

.boat-equipment {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.equip-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
  border-radius: 3px;
}

.boat-notes {
  font-size: 12px;
  color: var(--on-surface-variant);
  border-left: 2px solid var(--outline-variant);
  padding-left: 10px;
  line-height: 1.6;
}

.boat-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.boat-rating { font-size: 12px; color: var(--outline); }

.boat-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--on-surface-variant);
  text-decoration: none;
  border-bottom: 1px solid var(--outline);
  white-space: nowrap;
  padding-bottom: 1px;
}
.boat-link:hover { color: var(--on-surface); border-bottom-color: var(--on-surface); }

/* Tags */
.tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
  font-family: 'Clash Grotesk', sans-serif;
  border-radius: 3px;
}
.tag.ink  { background: var(--ink-soft);   color: var(--sage); }
.tag.warn { background: var(--sienna-soft); color: var(--sienna); }

/* ===== VOTES ===== */
.vote-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--outline-variant);
  border: 1px solid var(--outline-variant);
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
}

.vote-row-item {
  background: var(--surface-container);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.vote-boat-name {
  font-weight: 600;
  font-size: 13px;
  min-width: 120px;
  color: var(--on-surface);
}

.vote-boat-model {
  font-size: 12px;
  color: var(--on-surface-variant);
  flex: 1;
}

.stars { display: flex; gap: 3px; }

.star {
  font-size: 20px;
  color: var(--surface-container-highest);
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s, transform 0.12s;
  user-select: none;
}
.star.filled { color: var(--sage-dark); }
.star:hover, .star.hover { color: var(--sage); }

/* Vote summary */
.vote-summary { margin-top: 8px; }
.vote-summary table { font-size: 11px; }
.vote-summary th { font-size: 9px; }
.vote-summary td { padding: 7px 10px; }

.star-cell { color: var(--on-surface); font-size: 11px; }
.no-vote   { color: var(--outline-variant); font-size: 11px; }
.avg-cell  { font-weight: 700; color: var(--on-surface); }

/* ===== CRÉNEAUX ===== */
.creneaux-info {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 16px;
  padding: 12px 14px;
  border-left: 2px solid var(--outline-variant);
  background: var(--surface-container-low);
  line-height: 1.6;
}

.grid-wrap { overflow-x: auto; margin-bottom: 24px; }

.creneaux-grid {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 11px;
}

.creneaux-grid th {
  background: var(--surface-container);
  padding: 8px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  white-space: nowrap;
  border: 1px solid var(--outline-variant);
  text-align: center;
  font-family: 'Clash Grotesk', sans-serif;
}

.creneaux-grid th.user-col { text-align: left; min-width: 80px; }

.creneaux-grid td {
  border: 1px solid var(--outline-variant);
  text-align: center;
  padding: 0;
}

.creneaux-grid td.user-name-cell {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  background: var(--surface-container-low);
  color: var(--on-surface);
}

.day-cell {
  width: 36px;
  height: 36px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.day-cell.editable { cursor: pointer; }
.day-cell.editable:hover { background: var(--surface-container-high); }

.day-cell.available   { background: var(--ink-soft);  color: var(--sage); }
.day-cell.unavailable { background: var(--surface);   color: var(--outline-variant); }
.day-cell.unknown     { background: var(--surface);   color: var(--outline-variant); }

.trip-day th { background: var(--surface-container-high); }
.trip-day td.day-cell.available { background: var(--ink-soft); }

/* ===== AVAIL COUNT ROW ===== */
.avail-count-label {
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--outline) !important;
  font-family: 'Clash Grotesk', sans-serif;
}

.day-cell.count-cell {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Clash Grotesk', sans-serif;
  cursor: default;
  color: transparent;
}
.day-cell.count-partial {
  color: var(--sage);
  background: rgba(163, 196, 180, 0.1);
}
.day-cell.count-full {
  color: var(--sage);
  background: var(--ink-soft);
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  border: none;
  border-top: 1px solid var(--outline-variant);
  margin: 36px 0;
}

/* ===== INLINE VOTE SUR CARTES ===== */
.boat-vote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--outline-variant);
  margin-top: 4px;
}

.boat-vote-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--outline);
  white-space: nowrap;
  font-family: 'Clash Grotesk', sans-serif;
}

.boat-vote-saved {
  font-size: 10px;
  color: var(--sage);
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: auto;
}
.boat-vote-saved.visible { opacity: 1; }

/* ===== WELCOME OVERLAY ===== */
#welcome-overlay {
  position: fixed;
  inset: 0;
  background: #08080e;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
#welcome-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}
#welcome-overlay.hidden { display: none; }

.overlay-inner {
  text-align: center;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
}

.overlay-sub {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--outline);
  margin-bottom: 14px;
  font-family: 'Clash Grotesk', sans-serif;
}

.overlay-title {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 52px;
  font-weight: 900;
  color: var(--on-surface);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 14px;
}

.overlay-desc {
  font-size: 13px;
  color: var(--outline);
  line-height: 1.6;
  margin-bottom: 28px;
}

.overlay-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--outline);
  margin-bottom: 14px;
  font-family: 'Clash Grotesk', sans-serif;
}

.overlay-names {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.overlay-name-btn {
  border: 1px solid var(--outline-variant);
  background: none;
  color: var(--on-surface);
  font-family: 'Clash Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.overlay-name-btn:hover { border-color: var(--outline); }
.overlay-name-btn.selected {
  background: var(--on-surface);
  color: var(--surface);
  border-color: var(--on-surface);
}

.overlay-btn {
  background: var(--on-surface);
  color: var(--surface);
  border: none;
  font-family: 'Clash Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 32px;
  cursor: pointer;
  letter-spacing: 0.05em;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.overlay-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.overlay-btn:not(:disabled):hover { opacity: 0.85; }

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .boat-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .photo-carousel {
    height: 240px;
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .container { padding: 20px 12px; }
  header { padding: 0 12px; }
  .header-meta { display: none; }
  .boat-body { padding: 20px; }
  .vote-row-item { flex-wrap: wrap; }
  .vote-boat-name { min-width: 0; width: 100%; }
  table { font-size: 11px; }
  th, td { padding: 6px 8px; }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-content.active { animation: fadeUp 0.2s ease both; }

.star:active { transform: scale(1.35); }

tr { transition: background-color 0.1s; }
