/* style.css */

/* Prevent iOS Safari from auto-adjusting text size */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 2rem auto;
  max-width: 700px;
  /* Safe‑area padding for notched devices */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1,
h2 {
  text-align: center;
}

.controls {
  text-align: center;
  margin-bottom: 1rem;
}

/* Ensure form controls are at least 16px to prevent iOS zoom */
select#zone-select,
input[type="number"],
button {
  font-size: 16px;
}

#zone-select {
  padding: 0.3rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th,
td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
}

th {
  background: #f0f0f0;
}

button {
  display: block;
  margin: 0.5rem auto 1rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
}

.hint {
  font-size: 0.9rem;
  text-align: center;
  color: #555;
}

.hidden {
  display: none;
}

input[type="number"] {
  width: 5rem;
  padding: 0.2rem;
}

/* Mobile‑first tweaks for iPhone Pro Max (≤428px) */
@media (max-width: 428px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .controls,
  .hint {
    padding: 0 1rem;
  }

  select#zone-select,
  input[type="number"],
  button {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    box-sizing: border-box;
  }

  table {
    font-size: 0.9rem;
    min-width: 320px;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }
}

/* zebra-striped for readability */
#next-seat-table tbody tr:nth-child(odd) {
  background: #f9f9f9;
}

/* highlight the party closest to winning another seat */
.next-lowest {
  background: #e0f7fa;
}

/* banner */
.threshold-row td {
  background: #fff3cd;
}

/* zebra striping */
#next-seat-table tbody tr:nth-child(odd) {
  background: #f9f9f9;
}

/* mobile: stack tables vertically */
@media (max-width: 600px) {

  #results-zone,
  #next-seat-zone {
    margin-bottom: 2rem;
  }
}