:root {
  --bg: #f0ece2;
  --ink: #1b2d2f;
  --ink-soft: #5a6d72;
  --brand: #0d5f66;
  --brand-strong: #083f44;
  --accent: #d66b19;
  --card: #fffdf8;
  --line: #d8d0c0;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #fffaf2 0, transparent 35%),
    radial-gradient(circle at 90% 10%, #f3faf9 0, transparent 40%),
    linear-gradient(180deg, #f4efe5 0%, #ece4d5 100%);
  line-height: 1.45;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 1000;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px clamp(14px, 4vw, 40px) 12px;
}

.hero-copy {
  max-width: 720px;
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 4px 0 8px;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1.05;
  color: var(--brand-strong);
}

h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
  color: var(--ink-soft);
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #9ad2cc;
  color: var(--brand-strong);
  background: #e6faf7;
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px clamp(12px, 4vw, 40px) 10px;
  background: linear-gradient(180deg, rgba(240, 236, 226, 0.95), rgba(240, 236, 226, 0.78));
  backdrop-filter: blur(8px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8f1;
  color: var(--ink);
  font-weight: 700;
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.layout {
  display: grid;
  gap: 14px;
  padding: 8px clamp(12px, 4vw, 40px) 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card {
  background: linear-gradient(180deg, #fffefb 0%, #fffaf0 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(14px, 3vw, 20px);
  box-shadow: 0 10px 25px rgba(32, 24, 12, 0.08);
  min-width: 0;
}

.inline-form,
.grid-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.inline-form {
  grid-template-columns: 1fr auto;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d8d2c4;
  font: inherit;
}

input[type='checkbox'],
input[type='radio'] {
  width: auto;
  height: 18px;
  min-width: 18px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

input,
select,
textarea {
  background: #fff;
  min-width: 0;
}

button {
  border: none;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #15747b 0%, #0d5f66 100%);
  color: #fff;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 148, 158, 0.35);
  outline-offset: 1px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.list li {
  background: #fff;
  border: 1px solid #ece5d8;
  border-radius: 12px;
  padding: 10px 12px;
}

.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.player-row span {
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-row button {
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.hint {
  margin: 4px 0 10px;
  color: var(--ink-soft);
}

.ghost-btn {
  margin: 6px 0 10px;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

#back-to-players,
#back-to-suggestions {
  display: inline-block;
  width: auto;
}

.suggestion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.suggestion-text {
  font-weight: 700;
}

.suggestion-sub {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.suggestion-btn {
  width: auto;
  min-width: 100px;
  background: linear-gradient(180deg, #e67e22 0%, #d66b19 100%);
}

.selected-match {
  margin-top: 10px;
  border: 1px solid #f2d2b3;
  background: #fff5e8;
  border-radius: 12px;
  padding: 10px 12px;
}

.hidden {
  display: none;
}

/* ── Attendance refonte ── */
.attendance-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.session-label {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.session-label strong {
  color: var(--ink);
}

.attendance-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-strong);
  background: #e6f7f5;
  border: 1.5px solid #b0ddd9;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}

.attendance {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #c5e0dd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
  user-select: none;
  min-width: 0;
}

.att-chip input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.att-name {
  padding: 8px 15px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand);
  transition: color 0.15s;
  line-height: 1.2;
}

.att-chip:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 95, 102, 0.1);
}

.att-chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
}

.att-chip:has(input:checked) .att-name {
  color: #fff;
}

.attendance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.attendance-actions .btn-save {
  grid-column: 1 / -1;
}

.adjust-actions {
  grid-template-columns: repeat(3, 1fr);
}

.danger-btn {
  background: linear-gradient(180deg, #ca2f1f 0%, var(--danger) 100%);
}

.ticker {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #e8dfcf;
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  padding: 8px 0;
  animation: ticker 22s linear infinite;
}

.ticker-item {
  display: inline-block;
  margin: 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #edf8f7;
  border: 1px solid #cce7e3;
  font-weight: 700;
  font-size: 0.9rem;
}

.ticker-empty {
  margin-top: 10px;
  color: var(--ink-soft);
  padding: 10px 12px;
  border: 1px dashed #d8cfbe;
  border-radius: 12px;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e8dfcf;
  border-radius: 12px;
  background: #fff;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #efe8db;
  padding: 9px 8px;
}

th {
  background: #fcf7ed;
  color: #42595e;
  font-size: 0.9rem;
}


@media (max-width: 768px) {
  body {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .hero {
    flex-direction: column;
    padding: 14px 14px 8px;
  }

  .tabs {
    padding: 8px 10px 10px;
  }

  .tab-btn {
    font-size: 0.92rem;
  }

  .layout {
    padding: 6px 10px 22px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .suggestion-row {
    flex-direction: column;
    align-items: stretch;
  }

  .suggestion-btn,
  .player-row button {
    width: 100%;
  }

  #back-to-players,
  #back-to-suggestions {
    width: 100%;
  }

  .attendance-actions {
    grid-template-columns: 1fr;
  }

  .attendance-actions .btn-save {
    grid-column: auto;
  }

  .adjust-actions {
    grid-template-columns: 1fr;
  }
}
