/* =========================
   BASE
========================= */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
}

/* =========================
   HEADER
========================= */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #1a1a1a, #111);
  color: #fff;
  padding: 10px 12px 12px;
}

header .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
}

header .round-count {
  font-size: 13px;
  opacity: 0.8;
}

/* =========================
   SCORES HEADER
========================= */
#scores {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}

.score {
  display: grid;
  grid-template-columns: 1fr auto; /* nom | points */
  align-items: center;
  background: #b5b5b5;
  border-radius: 10px;
  padding: 6px 10px;
  column-gap: 12px;
}

.score .name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score .pts {
  font-size: 18px;
  font-weight: bold;
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* états */
.score.leader {
  background: #2e7d32;
}

.score.warning {
  background: #ff9800;
  color: #111;
}

.score.danger {
  background: #d32f2f;
  color: #fff;
}

/* =========================
   MAIN CONTENT
========================= */
main {
  padding: 10px;
}

#app {
  height: calc(100svh - 170px);
  overflow-y: auto;
}

/* =========================
   ROUNDS
========================= */
.round {
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  border-left: 6px solid #ff9800;
}

.round strong {
  display: block;
  margin-bottom: 4px;
}

.round.current {
  border-left-color: #4caf50;
  background: #f1fff3;
}

.scores-line {
  margin-top: 6px;
  font-size: 14px;
}

/* =========================
   BUTTONS
========================= */
button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  border-radius: 12px;
  background: #ff9800;
  color: #111;
  border: none;
  font-weight: bold;
    margin-top: 10px
}

button:active {
  transform: scale(0.97);
}

/* =========================
   FOOTER
========================= */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: #111;
  box-shadow: 0 -2px 8px rgba(0,0,0,.2);
    
    display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#mainAction {
  padding: 14px;
  font-size: 17px;
  border-radius: 14px;
  background: #ff9800;
  color: #111;
  border: none;
  font-weight: bold;
}

button.secondary {
  padding: 14px;
  font-size: 16px;
  border-radius: 14px;
  background: #333;
  color: #fff;
  border: none;
  min-width: 56px;
    margin-top: 10px;
}

button.secondary:active,
#mainAction:active {
  transform: scale(0.96);
}

/* =========================
   MODAL
========================= */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  place-items: center;
}

#modal.active {
  display: grid;
}

.modal-box {
  background: #fff;
  padding: 20px;
  width: 90%;
  border-radius: 10px;
}

.modal-box input {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  font-size: 16px;
}

input#name {
    line-height: 30px;
    padding-left: 10px;
    width: 400px;
    border-radius: 6px;
    border: 1px solid #dedede;
}