:root {
  --bg: #f2efe9;
  --card: #ffffff;
  --ink: #1d1c1a;
  --muted: #6a655d;
  --accent: #d07a3d;
  --accent-dark: #b5662f;
  --border: #e2dbd0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background:
    linear-gradient(rgba(242, 239, 233, 0.85), rgba(242, 239, 233, 0.85)),
    url("photo/background.png") center / cover no-repeat fixed;
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  flex: 1;
}

.page {
  max-width: 980px;
  margin: 40px auto 64px;
  padding: 0 20px;
}

.hero {
  margin-bottom: 22px;
}

.hero-split {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: center;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.hero-center {
  text-align: center;
}

.hero-logo {
  width: 100%;
  max-width: 120px;
  height: auto;
  justify-self: center;
}

.hero-logo.right {
  max-width: 180px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: #7a6d60;
  margin: 0 0 6px;
}

h1 {
  font-size: 40px;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.event-title {
  display: inline-block;
  background: linear-gradient(90deg, #b11211 0%, #e36b1f 45%, #1d1c1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.subtitle-strong {
  margin-top: 14px;
  font-weight: 700;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}

.card.invalid {
  border-color: #c62828;
  box-shadow:
    0 0 0 2px rgba(198, 40, 40, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.06);
}

.logo-top {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px 16px;
}

.logo-top img {
  max-width: 160px;
  height: auto;
}

.form-layout {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label,
fieldset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.section-title {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  font-size: 14px;
}

.info-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.text-red {
  color: #dc2626;
}

.submit-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.submit-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#submitAll {
  background: #c62828;
  color: #ffd54f;
  border-radius: 0;
  padding: 12px 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#submitAll:hover {
  background: #b71c1c;
}

.site-footer {
  text-align: center;
  padding: 16px 12px 28px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.site-footer .brand {
  color: #c62828;
  font-weight: 700;
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background-color: transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(208, 122, 61, 0.2);
  border-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(208, 122, 61, 0.12);
}

input[type="file"] {
  background-color: transparent;
}

input[type="file"]::file-selector-button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  margin-right: 8px;
  cursor: pointer;
}

input[type="file"]:focus::file-selector-button {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent);
}

.radio-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.radio-group legend {
  padding: 0 6px;
  color: var(--muted);
}

.radio-group label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.full {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

#playersTableWrap.hidden {
  display: none;
}

.hidden {
  display: none;
}

.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.player-table th,
.player-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.player-table th {
  color: var(--muted);
  font-weight: 600;
}

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(29, 28, 26, 0.5);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1100;
}

.preview-modal.hidden {
  display: none;
}

.success-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 12, 9, 0.62);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1200;
}

.success-modal.hidden {
  display: none;
}

.success-card {
  width: min(540px, 100%);
  background: linear-gradient(165deg, #fffaf0 0%, #fff 58%, #fff4d9 100%);
  border: 1px solid #ead8b5;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 26px 24px 24px;
  text-align: center;
  position: relative;
}

.success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid #e3bf85;
  color: #8a5a1a;
  border-radius: 999px;
  padding: 6px 14px;
}

.success-logo {
  width: 170px;
  max-width: 68%;
  display: block;
  margin: 6px auto 14px;
}

.success-card h2 {
  margin: 0 0 10px;
  font-size: 31px;
  color: #5a1e14;
}

.success-text {
  margin: 0 0 12px;
  font-size: 18px;
}

.success-id {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px dashed #d4b37f;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 15px;
  word-break: break-word;
}

.success-tags {
  margin: 0 0 16px;
  color: #8f4d1c;
  font-weight: 700;
  line-height: 1.55;
}

.success-fb-link {
  display: block;
  margin-bottom: 16px;
  font-weight: 700;
  color: #1b5fc6;
}

.success-done {
  display: block;
  margin: 0 auto;
  background: #c62828;
  color: #ffd54f;
  padding: 11px 28px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.success-done:hover {
  background: #b71c1c;
}

.preview-card {
  width: min(900px, 100%);
  max-height: 85vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.preview-header h2 {
  margin: 0;
  font-size: 22px;
}

.preview-content {
  padding: 16px 22px 12px;
  overflow: auto;
}

.preview-section {
  margin-bottom: 16px;
}

.preview-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.preview-list {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 8px 16px;
  font-size: 14px;
}

.preview-list dt {
  color: var(--muted);
  font-weight: 600;
}

.preview-list dd {
  margin: 0;
}

.preview-image {
  display: block;
  max-width: 220px;
  max-height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.preview-image-small {
  max-width: 80px;
  max-height: 60px;
}

.preview-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
}

#confirmSubmit {
  background: #c62828;
  color: #ffd54f;
  border-radius: 0;
  padding: 12px 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#confirmSubmit:hover {
  background: #b71c1c;
}

.captain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e36b1f;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

#recordsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#recordsTable th,
#recordsTable td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

#recordsTable th {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 600px) {
  h1 {
    font-size: 28px;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .logo-top img {
    max-width: 140px;
  }
  .hero-split {
    grid-template-columns: 1fr;
  }
  .hero-logo {
    max-width: 140px;
  }
  .hero-logo.right {
    max-width: 170px;
  }
}
