:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #132033;
  background: #eef2f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 2.6rem;
  border: 0;
  border-radius: 8px;
  background: #0f3d64;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 1rem;
}

button:hover {
  filter: brightness(1.06);
}

button.primary {
  background: #d5a12b;
  color: #152033;
}

button.danger {
  background: #b42318;
}

.hidden,
body:not(.admin-mode) .admin-only {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(238, 242, 246, 0) 0, rgba(238, 242, 246, 0.9) 39rem, #eef2f6 48rem),
    url("assets/torneo-2026-a.jpg");
  background-attachment: fixed;
  background-position: center top;
  background-size: cover;
}

.site-header {
  background:
    linear-gradient(180deg, rgba(6, 25, 43, 0.26), rgba(6, 25, 43, 0.54) 68%, rgba(6, 25, 43, 0.78)),
    url("assets/torneo-2026-a.jpg");
  background-position: center 30%;
  background-size: cover;
  color: #ffffff;
  min-height: 34rem;
  display: grid;
  align-content: end;
  padding: 2.25rem 1rem 4rem;
  text-align: center;
}

.club-logo {
  width: min(9rem, 42vw);
  aspect-ratio: 1;
  border: 6px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.24);
  object-fit: cover;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 1.1rem 0 0.35rem;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow: 0 0.35rem 1.5rem rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
}

.site-header h2 {
  margin-bottom: 0.45rem;
  color: #f7d77a;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  text-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.5);
}

.site-header p {
  margin-bottom: 0;
  color: #e6edf5;
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.5);
}

.content {
  width: min(100% - 2rem, 72rem);
  margin: -2.7rem auto 0;
  padding-bottom: 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.summary-grid article,
.table-section,
.rules-section,
.admin-strip,
.admin-panel {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1rem 2rem rgba(18, 32, 51, 0.08);
}

.summary-grid article {
  padding: 1rem;
  text-align: center;
}

.summary-grid strong {
  display: block;
  color: #0f3d64;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
}

.summary-grid span {
  display: block;
  margin-top: 0.35rem;
  color: #5b6778;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.table-section,
.rules-section,
.admin-strip,
.admin-panel {
  margin-bottom: 1rem;
}

h3 {
  margin: 0;
  padding: 1rem 1rem 0;
  color: #132033;
  font-size: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
  padding: 1rem;
}

table {
  width: 100%;
  min-width: 58rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th,
td {
  border-bottom: 1px solid #dce4ee;
  padding: 0.75rem;
  vertical-align: middle;
}

th {
  background: #f1f5f9;
  color: #24364a;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

.boat-name,
.points {
  font-weight: 900;
}

.boat-name {
  color: #0f3d64;
}

.points {
  color: #8b5e06;
}

.empty-row {
  color: #66768a;
  text-align: center;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.rules-grid article {
  display: grid;
  gap: 0.45rem;
  border-left: 4px solid #d5a12b;
  border-radius: 8px;
  background: #f8fafc;
  padding: 1rem;
}

.rules-grid span {
  color: #4f6074;
}

.admin-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.admin-strip p,
.read-note {
  margin: 0;
  color: #5b6778;
  font-weight: 700;
}

.button-row,
.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-panel {
  padding: 1rem;
}

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-heading h3 {
  padding: 0;
}

.admin-heading p {
  margin: 0.3rem 0 0;
  color: #5b6778;
}

form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #314257;
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #132033;
  outline: none;
  padding: 0.72rem 0.8rem;
}

input:focus {
  border-color: #0f3d64;
  box-shadow: 0 0 0 3px rgba(15, 61, 100, 0.16);
}

.form-actions {
  align-items: end;
  grid-column: 1 / -1;
}

.read-note {
  padding: 0 0.25rem 1rem;
  text-align: center;
}

footer {
  padding: 1.5rem 1rem 2rem;
  color: #5b6778;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(7, 21, 36, 0.64);
  padding: 1rem;
}

.modal-card {
  position: relative;
  width: min(100%, 24rem);
  border-radius: 8px;
  background: #ffffff;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  background: #eef2f6;
  color: #132033;
  font-size: 1.3rem;
}

.modal-logo {
  width: 5.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

.modal-card h2 {
  margin: 0.65rem 0 0.35rem;
}

.modal-card p {
  color: #5b6778;
}

.modal-card form {
  grid-template-columns: 1fr;
  text-align: left;
}

@media (max-width: 760px) {
  .page-shell {
    background-attachment: scroll;
    background-position: center top;
  }

  .site-header {
    min-height: 31rem;
    background-position: center top;
    padding-bottom: 3.25rem;
  }

  .content {
    width: min(100% - 1rem, 72rem);
  }

  .summary-grid,
  .rules-grid,
  form {
    grid-template-columns: 1fr;
  }

  .admin-strip,
  .admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row,
  .form-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .admin-strip,
  .admin-panel,
  .modal,
  .admin-only,
  .read-note,
  footer {
    display: none !important;
  }

  .content {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .summary-grid article,
  .table-section,
  .rules-section {
    box-shadow: none;
  }
}
