:root {
  --navy: #0a1628;
  --navy-mid: #0f2847;
  --purple: #1e3a8a;
  --yellow: #ffd700;
  --yellow-glow: #ffe566;
  --cyan: #7df9ff;
  --white: #f8fafc;
  --panel: rgba(15, 40, 71, 0.85);
  --radius: 12px;
  --font-display: "Bangers", Impact, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--white);
  background: linear-gradient(135deg, var(--navy) 0%, #0a192f 40%, var(--purple) 100%);
  background-attachment: fixed;
  line-height: 1.5;
}

.lightning-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 48px,
    rgba(255, 215, 0, 0.03) 48px,
    rgba(255, 215, 0, 0.03) 49px
  );
}

.bolt {
  position: absolute;
  font-size: var(--bolt-size, 1.5rem);
  color: var(--yellow);
  opacity: 0.12;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
  transform: rotate(var(--bolt-rot, -12deg));
  animation: flicker var(--bolt-dur, 3.2s) ease-in-out infinite;
  animation-delay: var(--bolt-delay, 0s);
}

.bolt--strike {
  animation-name: bolt-strike;
  animation-duration: var(--bolt-dur, 4.8s);
}

.bolt-1 { top: 8%; left: 5%; --bolt-rot: -22deg; --bolt-size: 1.65rem; --bolt-delay: 0s; --bolt-dur: 3s; }
.bolt-2 { top: 22%; right: 8%; --bolt-rot: 14deg; --bolt-size: 1.35rem; --bolt-delay: 0.7s; --bolt-dur: 4.2s; }
.bolt-3 { top: 55%; left: 12%; --bolt-rot: -8deg; --bolt-size: 1.85rem; --bolt-delay: 1.2s; --bolt-dur: 3.6s; }
.bolt-4 { bottom: 20%; right: 15%; --bolt-rot: 20deg; --bolt-size: 1.2rem; --bolt-delay: 0.4s; --bolt-dur: 5.1s; }
.bolt-5 { bottom: 8%; left: 40%; --bolt-rot: -15deg; --bolt-size: 1.55rem; --bolt-delay: 1.8s; --bolt-dur: 3.4s; }
.bolt-6 { top: 4%; right: 24%; --bolt-rot: 8deg; --bolt-size: 1.1rem; --bolt-delay: 2.1s; --bolt-dur: 3.9s; }
.bolt-7 { top: 38%; right: 3%; --bolt-rot: -28deg; --bolt-size: 2rem; --bolt-delay: 0.3s; --bolt-dur: 3.1s; }
.bolt-8 { top: 42%; left: 36%; --bolt-rot: 18deg; --bolt-size: 0.95rem; --bolt-delay: 1.5s; --bolt-dur: 5.4s; }
.bolt-9 { top: 72%; right: 26%; --bolt-rot: -12deg; --bolt-size: 1.45rem; --bolt-delay: 2.6s; --bolt-dur: 3.3s; }
.bolt-10 { top: 16%; left: 26%; --bolt-rot: 24deg; --bolt-size: 1.25rem; --bolt-delay: 0.9s; --bolt-dur: 4.6s; }
.bolt-11 { bottom: 34%; left: 2%; --bolt-rot: -18deg; --bolt-size: 1.75rem; --bolt-delay: 1.1s; --bolt-dur: 3.7s; }
.bolt-12 { bottom: 11%; right: 36%; --bolt-rot: 10deg; --bolt-size: 1.05rem; --bolt-delay: 2.3s; --bolt-dur: 4.1s; }
.bolt-13 { top: 64%; left: 70%; --bolt-rot: -25deg; --bolt-size: 1.6rem; --bolt-delay: 0.6s; --bolt-dur: 3.5s; }
.bolt-14 { bottom: 44%; right: 4%; --bolt-rot: 16deg; --bolt-size: 1.3rem; --bolt-delay: 1.9s; --bolt-dur: 5s; }
.bolt-15 { top: 84%; left: 52%; --bolt-rot: -6deg; --bolt-size: 1.9rem; --bolt-delay: 2.8s; --bolt-dur: 3.8s; }

@keyframes flicker {
  0%, 100% {
    opacity: 0.07;
    filter: brightness(0.9);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1);
  }
  45% {
    opacity: 0.28;
    filter: brightness(1.15);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.06);
  }
  50% {
    opacity: 0.38;
    filter: brightness(1.35);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.12);
  }
  55% {
    opacity: 0.22;
    filter: brightness(1.05);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.04);
  }
}

@keyframes bolt-strike {
  0%, 82%, 100% {
    opacity: 0.05;
    filter: brightness(0.85);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1);
  }
  88% {
    opacity: 0.48;
    filter: brightness(1.5);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.14);
  }
  92% {
    opacity: 0.12;
    filter: brightness(1);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.02);
  }
  95% {
    opacity: 0.42;
    filter: brightness(1.4);
    transform: rotate(var(--bolt-rot, -12deg)) scale(1.1);
  }
}

.hero,
main,
footer {
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  padding: 1.5rem 1rem 0;
}

.hero-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--yellow);
  color: var(--navy);
  padding: 0.5rem 1.25rem;
  border: 3px dashed var(--navy);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.4);
}

.hero-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 400;
}

.bolt-icon {
  font-size: 1.75rem;
  animation: flicker 2s ease-in-out infinite;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-panel {
  background: var(--panel);
  border: 2px solid rgba(255, 215, 0, 0.35);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.rules-accordion {
  background: var(--panel);
  border: 2px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.rules-accordion > summary {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s, background 0.2s;
}

.rules-accordion > summary::-webkit-details-marker {
  display: none;
}

.rules-accordion > summary::after {
  content: " ⚡";
  opacity: 0.6;
}

.rules-accordion[open] > summary {
  color: var(--yellow);
  border-bottom: 1px solid rgba(255, 215, 0, 0.25);
}

.rules-accordion[open] > summary::after {
  content: " ▲";
  opacity: 1;
}

.rules-accordion > summary:hover {
  background: rgba(255, 215, 0, 0.06);
  color: var(--yellow);
}

.rules-accordion .rules-panel {
  padding: 1rem 1.5rem 1.25rem;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.form-mount h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--yellow);
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.rules-intro {
  margin: 0 0 1rem;
  opacity: 0.95;
}

.rules-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.rules-list li {
  margin-bottom: 0.35rem;
}

.points-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.points-table th,
.points-table td {
  border: 1px solid rgba(125, 249, 255, 0.25);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.points-table th {
  background: rgba(30, 58, 138, 0.6);
  color: var(--cyan);
}

.points-table .cap-row td {
  font-weight: 700;
  color: var(--yellow);
}

.rules-graphic summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 600;
}

.rules-graphic img {
  max-width: 100%;
  margin-top: 0.75rem;
  border-radius: 8px;
}

.form-intro {
  margin: 0 0 1.25rem;
  opacity: 0.9;
}

#team-current-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.field-label,
.radio-field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--cyan);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid rgba(125, 249, 255, 0.35);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.8);
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.radio-field {
  border: none;
  margin: 0;
  padding: 0;
}

.activity-choice {
  position: relative;
  display: block;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.activity-choice:hover {
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.45);
}

.activity-choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.activity-choice-text {
  display: block;
}

.activity-choice:has(.activity-choice-input:checked) {
  border-color: var(--yellow);
  background: rgba(255, 215, 0, 0.14);
  box-shadow:
    0 0 0 2px rgba(255, 215, 0, 0.2),
    0 0 16px rgba(255, 215, 0, 0.35);
}

.activity-choice:has(.activity-choice-input:checked) .pts-badge {
  background: var(--navy);
  color: var(--yellow);
}

.activity-choice:has(.activity-choice-input:focus-visible) {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.pts-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.team-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.team-member {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 12px;
  transition: transform 0.15s, background 0.2s;
}

.team-member:hover {
  background: rgba(255, 215, 0, 0.08);
  transform: translateY(-2px);
}

.team-member-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.team-member-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  border: 3px solid rgba(125, 249, 255, 0.35);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.team-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  /* Zoom past baked-in PNG padding; circle clips overflow */
  transform: scale(1.38);
  display: block;
  pointer-events: none;
}

.team-member:has(.team-member-input:checked) .team-member-avatar {
  border-color: var(--yellow);
  box-shadow:
    0 0 0 3px rgba(255, 215, 0, 0.25),
    0 0 20px rgba(255, 215, 0, 0.55);
  transform: scale(1.06);
}

.team-member:has(.team-member-input:checked) .team-member-name {
  color: var(--yellow);
  font-weight: 700;
}

.team-member:has(.team-member-input:focus-visible) .team-member-avatar {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.team-member-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  color: var(--white);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry-list-row {
  padding: 1rem;
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.5);
}

.entry-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.entry-row-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--yellow);
}

.entry-field {
  margin-bottom: 0.65rem;
}

.entry-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.25rem;
}

.entry-activity-group {
  border: none;
  margin: 0;
  padding: 0;
}

.entry-activity-group .field-label {
  margin-bottom: 0.5rem;
}

.entry-activity-group .activity-choice:last-child {
  margin-bottom: 0;
}

.entry-link-field {
  padding-top: 0.75rem;
}

.entry-link {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid rgba(125, 249, 255, 0.35);
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.8);
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
}

.entry-link:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.btn-add-entry {
  align-self: flex-start;
  margin-top: 0.5rem;
  background: transparent;
  border: 2px dashed var(--yellow);
  color: var(--yellow);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  transition: background 0.2s, transform 0.15s;
}

.btn-add-entry:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-1px);
}

.btn-remove-entry {
  background: transparent;
  border: 1px solid rgba(255, 100, 100, 0.5);
  color: #ffb4b4;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

.btn-remove-entry:hover {
  background: rgba(255, 80, 80, 0.15);
}

.points-preview .cap-warn {
  color: #ffb86c;
  font-weight: 600;
}

.points-preview.over-cap {
  border-color: rgba(255, 150, 80, 0.6);
}

.url-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.url-list-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.url-list-row input {
  flex: 1;
}

.btn-add-link,
.btn-remove-link {
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  transition: transform 0.15s, background 0.2s;
}

.btn-add-link {
  align-self: flex-start;
  background: transparent;
  border: 2px dashed var(--cyan);
  color: var(--cyan);
  font-weight: 600;
}

.btn-add-link:hover {
  background: rgba(125, 249, 255, 0.1);
  transform: translateY(-1px);
}

.btn-remove-link {
  background: transparent;
  border: 1px solid rgba(255, 100, 100, 0.5);
  color: #ffb4b4;
  flex-shrink: 0;
}

.btn-remove-link:hover {
  background: rgba(255, 80, 80, 0.15);
}

.points-preview {
  margin: 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  font-size: 0.95rem;
}

.points-preview.has-points strong {
  color: var(--yellow);
  font-size: 1.15rem;
}

.btn-submit {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, var(--yellow) 0%, #e6c200 100%);
  color: var(--navy);
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--navy), 0 6px 20px rgba(255, 215, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--navy), 0 10px 28px rgba(255, 215, 0, 0.5);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--navy);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.form-status--loading {
  background: rgba(125, 249, 255, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
}

.form-status--success {
  background: rgba(100, 255, 150, 0.12);
  border: 1px solid #6f6;
  color: #9f9;
}

.form-status--error {
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid #f88;
  color: #fcc;
}

.form-success-flash {
  animation: zap-flash 0.6s ease;
}

@keyframes zap-flash {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.3); }
}

.loading,
.error {
  text-align: center;
  opacity: 0.85;
}

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .team-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }
}

@media (max-width: 520px) {
  .team-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .team-member {
    padding: 0.25rem;
  }

  .team-member-avatar {
    max-width: 88px;
  }

  .team-member-name {
    font-size: 0.65rem;
  }

  .url-list-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-remove-link {
    align-self: flex-end;
  }

  .entry-row-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
