/*
 * Loaded before tailwind.css. When utility CSS is missing or empty, these
 * rules keep forms and scoring controls readable (e.g. iPad / flaky CDN).
 * Tailwind layers override these for the same properties when present.
 */

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

body {
  margin: 0;
  background-color: #f3f4f6;
  color: #111827;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.orientation-aware {
  box-sizing: border-box;
}

/* Feedback FAB: inline styles also set — these reinforce on older WebKit (e.g. iPad iOS 15) if Tailwind fails */
#sk-feedback-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  -webkit-transform: translateZ(0);
}

/* Finalize button in fixed scoring header */
.scoring-finalize-btn {
  background-color: #16a34a;
  color: #fff;
}

/* --- New competition (competitions#new) --- */
.competition-setup .competition-setup-card {
  box-sizing: border-box;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.competition-setup input[type="text"],
.competition-setup input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: #fff;
}

.competition-setup button[type="button"] {
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0.75rem;
  min-width: 3.5rem;
  min-height: 3.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.competition-setup input[type="submit"] {
  box-sizing: border-box;
  width: 100%;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to right, #7c3aed, #4f46e5);
  cursor: pointer;
}

/* --- In-progress scoring (#competitors-list) --- */
#competitors-list {
  position: relative;
  z-index: 10;
  touch-action: manipulation;
}

/* Drag reorder is phone-only; hide handle on tablets (use 1–4 buttons) */
@media (min-width: 600px) {
  #competitors-list .sortable-drag-handle {
    display: none !important;
  }
}

#competitors-list .competitor-row {
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#competitors-list .position-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

#competitors-list .dq-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

#competitors-list select {
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  background: #fff;
}

/* Default: full scoring UI; phone read-only summary hidden until layout media queries */
.phone-landscape-summary {
  display: none;
}

.show-portrait {
  display: block;
}
