/* ========================================
   Spirit U8 — CSS Custom Properties
   ======================================== */

:root {
  --purple: #5B2D8E;
  --purple-dark: #4A2475;
  --purple-light: #7B4DB0;
  --teal: #2EC4B6;
  --teal-light: #56D4C8;
  --gold: #FFD600;
  --gold-light: #FFE34D;
  --bg: #F8F7FC;
  --bg-alt: #EFECF5;
  --text: #2D2D2D;
  --text-muted: #6B6B7B;
  --white: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(91, 45, 142, 0.08);
  --shadow-lg: 0 4px 20px rgba(91, 45, 142, 0.12);
  --transition: 0.2s ease;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--purple); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   Container
   ======================================== */

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   Access Gate
   ======================================== */

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 60%, #3A1A5E 100%);
  animation: gateFadeIn 0.4s ease;
}

@keyframes gateFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gate-content {
  text-align: center;
  padding: 40px 24px;
  width: 100%;
  max-width: 360px;
}

.gate-ball {
  font-size: 56px;
  margin-bottom: 12px;
  animation: gateBounce 2s ease-in-out infinite;
}

@keyframes gateBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.gate-title {
  font-size: 3rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.gate-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gold);
  margin-top: 4px;
  margin-bottom: 36px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.gate-input:focus {
  border-color: var(--gold);
}

.gate-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--purple-dark);
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  min-height: 48px;
}

.gate-btn:hover {
  background: var(--gold-light);
}

.gate-btn:active {
  transform: scale(0.98);
}

.gate-error {
  color: #FF6B6B;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 4px;
}

.gate--hidden {
  display: none;
}

/* ========================================
   Header
   ======================================== */

.header {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  padding: 40px 0 36px;
  text-align: center;
}

.header-ball {
  font-size: 40px;
  margin-bottom: 8px;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.header-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ========================================
   Sections
   ======================================== */

.section {
  padding: 32px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--gold);
  display: inline-block;
}

.section-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -12px;
  margin-bottom: 16px;
}

/* ========================================
   Announcement Cards
   ======================================== */

.announcement-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--purple);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.announcement-card:hover {
  box-shadow: var(--shadow-lg);
}

.announcement-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.announcement-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.announcement-body {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
}

/* ========================================
   Schedule
   ======================================== */

/* Desktop table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.schedule-table th {
  background: var(--purple);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  text-align: left;
}

.schedule-table td {
  padding: 12px 16px;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--bg-alt);
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.schedule-table tr:nth-child(even) td {
  background: var(--bg);
}

.schedule-table tr[data-type="practice"] td:first-child {
  box-shadow: inset 4px 0 0 var(--teal);
}

.schedule-table tr[data-type="game"] td:first-child {
  box-shadow: inset 4px 0 0 var(--gold);
}

/* Mobile schedule cards */
.schedule-cards {
  display: none;
}

.schedule-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.schedule-card--practice {
  border-left: 4px solid var(--teal);
}

.schedule-card--game {
  border-left: 4px solid var(--gold);
}

.schedule-card-event {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.schedule-card-type {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.schedule-card-type--practice {
  background: var(--teal);
  color: var(--white);
}

.schedule-card-type--game {
  background: var(--gold);
  color: var(--purple-dark);
}

.schedule-card-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.schedule-card-detail span {
  color: var(--text);
  font-weight: 500;
}

/* Schedule weather cells */
.schedule-weather-cell {
  font-size: 0.875rem;
  white-space: nowrap;
}

.weather-icon-sm {
  font-size: 1rem;
}

.weather-rain-sm {
  font-size: 0.75rem;
  font-weight: 600;
  color: #3B82F6;
  margin-left: 4px;
}

.weather-na {
  color: var(--text-muted);
}

/* Weather badge (mobile cards) */
.weather-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F9FF 100%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.weather-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.weather-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.weather-temp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.weather-details {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.weather-forecast {
  font-size: 0.8125rem;
  color: var(--text);
  font-weight: 500;
}

.share-schedule-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--purple);
  background: var(--white);
  border: 2px solid var(--purple-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
}

.share-schedule-btn:hover {
  background: var(--purple);
  color: var(--white);
}

@media (max-width: 600px) {
  .schedule-table-wrap { display: none; }
  .schedule-cards { display: block; }
}

/* ========================================
   Polls
   ======================================== */

.poll-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.poll-question {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poll-option-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--purple);
  background: var(--bg);
  border: 2px solid var(--purple-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.poll-option-btn:hover {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

.poll-option-btn:active {
  transform: scale(0.98);
}

/* Poll results */
.poll-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poll-result-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poll-result-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
}

.poll-result-pct {
  font-weight: 700;
  color: var(--purple);
}

.poll-result-bar-bg {
  height: 28px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.poll-result-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--purple-light) 100%);
  border-radius: 6px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.poll-result-bar--winner {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
}

.poll-voted-msg {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

.poll-inactive {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
}

.poll-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.poll-action-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--purple);
  background: var(--bg);
  border: 1px solid var(--purple-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.poll-action-btn:hover {
  background: var(--purple);
  color: var(--white);
}

.poll-action-btn--danger {
  color: #E53E3E;
  border-color: #E53E3E;
}

.poll-action-btn--danger:hover {
  background: #E53E3E;
  color: var(--white);
}

/* ========================================
   Forms
   ======================================== */

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.form-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.form-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required {
  color: #E53E3E;
  margin-left: 2px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  min-height: 48px;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--purple);
  background: var(--white);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236B6B7B'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-submit-btn {
  width: 100%;
  min-height: 48px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--white);
  background: var(--purple);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 8px;
}

.form-submit-btn:hover {
  background: var(--purple-dark);
}

.form-submit-btn:active {
  transform: scale(0.98);
}

.form-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-success {
  text-align: center;
  padding: 24px 0;
}

.form-success-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.form-success-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}

.form-success-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.form-edit-btn {
  margin-top: 16px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--purple);
  background: var(--bg);
  border: 1px solid var(--purple-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.form-edit-btn:hover {
  background: var(--purple);
  color: var(--white);
}

/* ========================================
   Cart Items
   ======================================== */

.cart-item {
  border: 2px solid var(--bg-alt);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.cart-item:has(.cart-item-checkbox:checked) {
  border-color: var(--purple-light);
}

.cart-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--bg);
  transition: background var(--transition);
}

.cart-item-header:hover {
  background: var(--bg-alt);
}

.cart-item-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--purple);
  flex-shrink: 0;
}

.cart-item-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.cart-item-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
}

.cart-item-image {
  margin: 0;
  border-radius: 0;
  padding: 12px 16px;
  max-height: 200px;
}

.cart-item-fields {
  padding: 0 16px 16px;
}

.cart-total {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--purple);
  text-align: right;
  padding: 12px 0;
  border-top: 2px solid var(--bg-alt);
  margin-top: 8px;
}

/* ========================================
   Form Images
   ======================================== */

.form-image {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  background: var(--bg);
  padding: 8px;
}

/* ========================================
   Sign-Ups
   ======================================== */

.signup-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.signup-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.signup-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.signup-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signup-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  gap: 12px;
}

.signup-slot-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.signup-slot-claimed {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(46, 196, 182, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.signup-slot-btn {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--white);
  background: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  min-height: 36px;
  white-space: nowrap;
}

.signup-slot-btn:hover {
  background: var(--purple-dark);
}

.signup-slot-btn:active {
  transform: scale(0.97);
}

.signup-slot-release {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: #E53E3E;
  background: transparent;
  border: 1px solid #E53E3E;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: 8px;
  white-space: nowrap;
  transition: all var(--transition);
}

.signup-slot-release:hover {
  background: #E53E3E;
  color: var(--white);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--purple-dark);
  padding: 32px 0;
  text-align: center;
}

.footer-motto {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.footer-credit {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}

/* ========================================
   Name Prompt Modal
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--bg-alt);
  border-radius: var(--radius-sm);
  outline: none;
  margin-bottom: 12px;
  min-height: 48px;
}

.modal input:focus {
  border-color: var(--purple);
}

.modal button {
  width: 100%;
  min-height: 48px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--white);
  background: var(--purple);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9375rem;
}

/* ========================================
   Alert Banner
   ======================================== */

.alert-banner {
  background: #E53E3E;
  color: var(--white);
  padding: 14px 20px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.alert-banner--warning {
  background: #DD6B20;
}

.alert-banner--info {
  background: var(--teal);
}

/* ========================================
   Game Results
   ======================================== */

.schedule-score {
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 6px;
}

.schedule-score--W {
  background: rgba(46, 196, 182, 0.15);
  color: #1a9e8f;
}

.schedule-score--L {
  background: rgba(229, 62, 62, 0.12);
  color: #E53E3E;
}

.schedule-score--T {
  background: rgba(107, 107, 123, 0.12);
  color: var(--text-muted);
}

.schedule-score--cancelled {
  background: rgba(229, 62, 62, 0.12);
  color: #E53E3E;
  text-decoration: line-through;
  font-style: italic;
}

.schedule-card-score {
  font-size: 1.125rem;
  font-weight: 800;
  margin-top: 8px;
}

.schedule-card-score--W { color: #1a9e8f; }
.schedule-card-score--L { color: #E53E3E; }
.schedule-card-score--T { color: var(--text-muted); }

.schedule-record {
  text-align: center;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--purple);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.schedule-record span {
  margin: 0 8px;
}

/* ========================================
   Summary Button
   ======================================== */

.summary-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 20px;
  padding: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--gold);
  background: transparent;
  border: 2px solid rgba(255, 214, 0, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.summary-btn:hover {
  background: rgba(255, 214, 0, 0.15);
  border-color: var(--gold);
}
