/* ==========================================================================
   Yellowstone Ranch Theme – styles.css
   ========================================================================== */

/* 1) IMPORT WESTERN SERIF FOR HEADINGS */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&display=swap');

/* 2) GLOBAL RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Segoe UI", sans-serif;
  background-color: #1b1a1a;
  background-image: url('assets/yellowstone-bg.png');
  background-position: center top;
  background-repeat: repeat-y;
  background-size: 100% auto;
  color: #e6dfc4;
  line-height: 1.6;
}

.uploader[hidden] {
  display: none;
}

/* 3) HEADING STYLES */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  color: #f0e2b6;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* 4) HEADER & NAVIGATION -- deprecated in favor of consolidated rules below */
/*
header {
    background: rgba(27,26,26,0.85);
    border-bottom: 2px solid #8b6f47;
    padding: 16px 0;
}
nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}
nav a {
  color: #e6dfc4;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
nav a:hover {
  background: rgba(230,226,196,0.1);
}
nav a.active {
  background: #8b6f47;
  color: #1b1a1a;
}
*/

/* 5) MAIN CONTENT WRAPPER */
main.content {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 16px;
}

/* 6) PANEL BASE (charred wood board) */
.panel, 
.summary-box, 
.highlight-box {
  background: rgba(27,26,26,0.8);
  border: 1px solid #3a2f23;
  border-radius: 6px;
  margin-bottom: 40px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
}

/* 7) HOME PAGE SPECIFIC */

/* Countdown */
.countdown-container {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.countdown-item {
  background: rgba(230,226,196,0.1);
  padding: 14px 18px;
  border-radius: 4px;
  text-align: center;
  transition: transform 0.15s;
}
.countdown-item.animate {
  transform: scale(1.1);
}
.countdown-value {
  display: block;
  font-size: 2.2rem;
  font-weight: bold;
  color: #f0e2b6;
}
.countdown-label {
  font-size: 0.85rem;
  color: #ccc5a8;
}

/* Tracker Grid */
.tracker-grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
}
.tracker-item {
  background: rgba(230,226,196,0.1);
  padding: 18px;
  border-radius: 6px;
  min-width: 160px;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}
.tracker-item strong {
  display: block;
  margin-bottom: 8px;
  color: #f0e2b6;
}

/* Finishes Grid */
.finishes-grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 16px;
}
.finish-item {
  background: rgba(230,226,196,0.1);
  padding: 36px;
  border-radius: 12px;
  min-width: 200px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.6);
  text-align: center;
  position: relative;
}
.finish-item ul {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-color: var(--accent) transparent; /* Firefox */
}
.finish-item ul::-webkit-scrollbar {
  width: 6px;
}
.finish-item ul::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.finish-item .emoji {
  display: block;
  font-size: 4rem;
  margin: 0 0 6px;
}

.medal-gold {
  background: linear-gradient(145deg, var(--accent), #b08968);
  color: #1b1a1a;
  border: 1px solid rgba(139, 105, 20, 0.6);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 6px 12px rgba(0,0,0,0.6);
  transition: transform 0.2s;
}
.medal-silver {
  background: linear-gradient(145deg, #c0c0c0, #a9a9a9);
  color: #1b1a1a;
  border: 1px solid rgba(90, 90, 90, 0.6);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 6px 12px rgba(0,0,0,0.6);
  transition: transform 0.2s;
}
.medal-gold:hover,
.medal-silver:hover {
  transform: scale(1.03);
}
.medal-gold .emoji,
.medal-silver .emoji {
  font-size: 4rem;
}
.medal-gold strong,
.medal-silver strong {
  font-weight: bold;
  font-size: 1.4rem;
}
.medal-gold::before,
.medal-silver::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 12px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.5), rgba(255,255,255,0.5) 6px, transparent 6px, transparent 12px);
  border-radius: 6px 6px 0 0;
}

/* 8) CALENDAR PAGE */
.calendar-section {
  /* reuse panel look */
}
#calendarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
#calendarHeader button {
  background: #8b6f47;
  border: none;
  color: #1b1a1a;
  padding: 8px 12px;
  font-size: 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#calendarHeader button:hover {
  background: #a2875a;
}
#calendarHeader h3 {
  font-size: 1.4rem;
  color: #f0e2b6;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 12px;
}
.calendar-day {
  background: rgba(230,226,196,0.05);
  border: 1px solid #3a2f23;
  border-radius: 6px;
  padding: 12px 0;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.calendar-day:hover {
  background: rgba(230,226,196,0.15);
}
.calendar-day.has-event {
  background: #8b6f47;
  color: #1b1a1a;
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.modal.show {
  /* show state makes modal visible */
  display: flex;
}
/* Card container */
.modal-box {
  background: #2a241f;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8);
  max-width: 420px;
  width: 90%;
  position: relative;
}
/* Close “×” button */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.4rem;
  color: #f8f4e9;
  background: none;
  border: none;
  cursor: pointer;
}
/* Form field styling */
.modal-box label {
  display: block;
  margin: 12px 0;
  color: #f8f4e9;
  font-family: inherit;
}
.modal-box label:first-of-type {
  margin-top: 0;
}
.modal-box input,
.modal-box textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #6f5436;
  border-radius: 6px;
  background: rgba(230,226,196,0.2);
  color: #f8f4e9;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  font-family: inherit;
}
/* Form action buttons */
.modal-box .actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Login prompt modal */
#loginModal .modal-box {
  text-align: center;
}
#loginModal .modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* 9) RODEO LOGS PAGE */
.rodeo-log-section h2 {
  border-bottom: 2px solid #3a2f23;
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 16px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  color: #ccc5a8;
  font-weight: 500;
}
.form-grid input,
.form-grid textarea {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #3a2f23;
  border-radius: 6px;
  background: rgba(230,226,196,0.05);
  color: #e6dfc4;
}
.form-grid .full-width {
  grid-column: 1/-1;
}
.form-grid button.full-width {
  background: #8b6f47;
  color: #1b1a1a;
  padding: 12px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
}
.form-grid button.full-width:hover {
  background: #a2875a;
}
#logList .log-entry {
  background: rgba(230,226,196,0.05);
  border-left: 6px solid #8b6f47;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 6px;
}
#logList .log-entry p {
  margin: 6px 0;
  color: #e6dfc4;
}
#logList .log-entry button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
}
#logList .log-entry button:first-of-type {
  background: #3a2f23; color: #e6dfc4;
}
#logList .log-entry button:last-of-type {
  background: #8b0000; color: #e6dfc4;
}

/* 10) ARENA LOG PAGE */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}
.toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ccc5a8;
}
.toolbar input[type="range"] { width: 100px; }
.toolbar button {
  padding: 6px 10px;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(230,226,196,0.1);
  color: #e6dfc4;
}
.toolbar button:hover { background: rgba(230,226,196,0.2); }

.diagram-area {
  position: relative;
  max-width: 800px;
  margin: 0 auto 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
  border-radius: 10px;
  overflow: hidden;
}
.diagram-area img,
.diagram-area canvas {
  display: block;
  width: 100%;
  height: auto;
}
#arenaNotes {
  width: 100%;
  max-width: 800px;
  min-height: 120px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #3a2f23;
  border-radius: 6px;
  resize: vertical;
  background: rgba(230,226,196,0.05);
  color: #e6dfc4;
  display: block;
  margin: 0 auto;
}
.notes-save-button {
  display: block;
  margin: 12px auto 40px;
  padding: 10px 20px;
  background: #8b6f47;
  color: #1b1a1a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.save-actions {
  text-align: center;
  margin: 16px 0;
}
.save-actions .save-btn {
  background: var(--accent);
  color: #1b1a1a;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.save-actions .save-btn:hover {
  filter: brightness(1.1);
}

/* 11) STATS PAGE */
.chart-container {
  background: rgba(27,26,26,0.8);
  border-radius: 6px;
  padding: 16px;
  margin-top: 24px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}
.stats-summary p {
  margin: 8px 0;
  color: #e6dfc4;
}
.stats-section label {
  color: #ccc5a8;
  font-weight: 500;
}

/* 12) PROFILES PAGE */
.profiles-section ul {
  list-style: none;
  padding-left: 0;
}
.profile-card {
  background: rgba(27,26,26,0.8);
  border: 1px solid #3a2f23;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.profile-card h3 {
  margin: 12px 0;
}
.profile-card img {
  max-width: 120px;
  border-radius: 6px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

/* 13) RESPONSIVE TWEAKS */
@media (max-width: 700px) {
  .tracker-grid, .finishes-grid,
  .calendar-grid, .countdown-container,
  .toolbar {
    flex-direction: column;
    align-items: center;
  }
  .calendar-grid {
    grid-template-columns: repeat(3,1fr);
  }
}
/* Medications tag list styling */
.meds-input-group {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}
.meds-input-group input {
  flex: 1;
  padding: 8px;
  border: 1px solid #3a2f23;
  border-radius: 6px;
  background: rgba(230,226,196,0.05);
  color: #e6dfc4;
}
.meds-input-group button {
  padding: 8px 12px;
  background: #8b6f47;
  color: #1b1a1a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.meds-input-group button:hover {
  background: #a2875a;
}

.med-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  grid-column: 1 / -1;
}
.med-list li {
  background: rgba(230,226,196,0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.med-list li button {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: #8b0000;
  cursor: pointer;
}
/* View Profile button/link */
.view-profile-btn {
  display: inline-block;
  margin: 8px 0;
  color: #f0e2b6;
  background: rgba(230,226,196,0.1);
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.view-profile-btn:hover {
  background: rgba(230,226,196,0.2);
}
/* === Grand Countdown Hero === */
.countdown-hero {
  position: relative;
  overflow: hidden;
  padding: 32px 24px 28px;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
    url('assets/rodeo-hero.jpg') center/cover no-repeat;
}

.countdown-headline {
  text-align: center;
  margin-bottom: 18px;
  animation: fadeInUp 0.8s ease-out both;
}
.countdown-headline .badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #8b6f47;
  border-radius: 999px;
  color: #f0e2b6;
  background: rgba(230,226,196,0.08);
  font-size: .85rem;
  letter-spacing: .06em;
}
.countdown-headline h2 {
  margin: 10px 0 6px;
  font-size: 2rem;
}
.countdown-headline p {
  color: #ccc5a8;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid of units */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px,1fr));
  gap: 18px;
  align-items: start;
  justify-items: center;
  margin: 6px auto 12px;
  max-width: 900px;
}

/* Circular progress rings (conic-gradient) */
.unit {
  --p: 0;                     /* progress 0..1 (set by JS) */
  --accent: #d7b26d;          /* ring color */
  position: relative;
  text-align: center;
}

.unit .ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  padding: 10px;               /* ring thickness */
  background:
    conic-gradient(var(--accent) calc(var(--p)*360deg), rgba(255,255,255,0.06) 0);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,0,0,0.5);
}
.unit .ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(200px 120px at 50% 20%, rgba(255,255,255,0.06), transparent 60%),
    rgba(0,0,0,0.35);
  box-shadow: inset 0 6px 18px rgba(0,0,0,0.55);
}

/* Big digits + labels */
.unit .digits {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.unit .digits span {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  color: #f0e2b6;
  text-shadow: 0 3px 10px rgba(0,0,0,0.6);
  transform-origin: center;
  transition: transform 0.15s ease-out;
}
.unit .digits small {
  display: block;
  margin-top: 112px; /* push label below number inside circle */
  font-size: .85rem;
  line-height: 1.2;
  color: #ccc5a8;
}

/* Tick “pop” when value changes */
.unit.pop .digits span {
  transform: scale(1.12);
}

/* Call-to-action button */
.countdown-cta {
  text-align: center;
  margin-top: 24px;
}
.countdown-cta .btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1rem;
  border: 1px solid #6b5532;
  border-radius: 8px;
  background: #ad8a4b;
  color: #23190d;
  cursor: pointer;
  transition: background 0.15s ease;
}
.countdown-cta .btn:hover {
  filter: brightness(1.05);
}

/* Smaller screens */
@media (max-width: 820px) {
  .countdown-grid { grid-template-columns: repeat(2, minmax(140px,1fr)); }
}
@media (max-width: 480px) {
  .countdown-grid { grid-template-columns: 1fr; }
  .unit .ring { width: 120px; height: 120px; }
  .unit .digits span { font-size: 2rem; }
  .unit .digits small { margin-top: 72px; }
}
/* ==== Profiles image centering + actions ==== */

#horsesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 12px;
  justify-content: center;
}

.card.glass{
  background: rgba(0,0,0,.35);
  border: 1px solid #6b5532;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.card.glass .img{
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;         /* thumbnail aspect */
  overflow: hidden;
  background: rgba(0,0,0,.18);
}

/* Force true center cropping; !important beats any global img rules */
.card.glass .img img{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: 50% 50% !important;  /* dead center */
  display: block;
}

.card.glass .pad{ padding: 12px 14px 8px; }

.card.glass .muted{
  color: #d2c6ad;
  opacity: .85;
  font-size: .95rem;
}

.card-actions{
  display:flex;
  gap: 8px;
  padding: 10px 14px 14px;
}

.card-actions .btn{
  padding: 6px 10px;
  font-size: .9rem;
  border-radius: 8px;
  border: 1px solid #6b5532;
  background: #ad8a4b;
  color: #23190d;
  cursor: pointer;
}
.card-actions .btn:hover{ filter: brightness(1.05); }
.card-actions .btn.ghost{
  background: rgba(0,0,0,.35);
  color: #e8dbc3;
}

/* Fallback for older browsers */
@supports not (aspect-ratio: 4 / 3){
  .card.glass .img{ padding-top: 75%; }
  .card.glass .img img{ position:absolute; top:0; left:0; }
}
/* Auth chip button styles */
.auth-chip .btn{
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid #6b5532;
  background: #ad8a4b; color: #23190d;
  text-decoration: none; cursor: pointer;
}
.auth-chip .btn:hover{ filter: brightness(1.05); }
.auth-chip .btn.ghost{ background: rgba(0,0,0,.35); color: #e8dbc3; }
/* ===== Horse profile page extras ===== */
.statband {
  display: flex;
  gap: 16px;
  margin: 10px 0 4px;
  flex-wrap: wrap;
}
.stat {
  min-width: 120px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(212,170,104,.35);
  border-radius: 10px;
  padding: 8px 12px;
}
.stat .label { font-size: .8rem; color: #d4aa68; letter-spacing: .03em; }
.stat .value { font-size: 1.15rem; font-weight: 700; color: #f3e5c7; }
.coggins-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
/* ===== Lightbox (click-to-enlarge) ===== */
.lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.85);
  display:none; align-items:center; justify-content:center;
  cursor:zoom-out; z-index:1000;
}
.lightbox img{
  max-width:92vw; max-height:92vh; border-radius:8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}

/* Small helper */
.small{ font-size:.9rem; opacity:.85; }
/* --- emergency modal visibility toggle --- */
#modal.modal-backdrop { display: none; }
#modal.modal-backdrop.show { display: flex !important; }
/* ===== TRJ emergency modal (safe to keep) ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* above everything */
}
.modal-backdrop.show { display: flex !important; }

.modal-card {
  width: min(680px, 92vw);
  background: #1f1a17;
  border: 1px solid #b08968;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  color: #f5e9d8;
  font-family: inherit;
}
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #b08968;
}
.modal-bd {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}
.modal-ft {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #b08968;
}
.modal-bd input,
.modal-bd select,
.modal-bd textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #7a5c3c;
  background: #2a241f;
  color: #f5e9d8;
}
.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #b08968;
  background: #b08968;
  color: #221a15;
  cursor: pointer;
}
.btn-lg { padding: 12px 24px; font-size: 1.1rem; }
.btn.ghost { background: transparent; color: #f5e9d8; }
.btn.danger { background: #553333; color: #fff; }
.forgot-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #ccc5a8;
  text-decoration: underline;
  background: none;
  border: none;
}
/* ===== Site header (shared across pages) ===== */
:root{
  --header-bg: rgba(0,0,0,.75);
  --header-border: rgba(212,166,90,.4);
  --accent: #d4a65a;
  --text-on-dark: #f5e9d8;
  --z-header: 50;
}

.site-header{
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Navigation row */

.header-inner{
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    width: 100%;
}


/* Auth chip */
.auth-chip{
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Navigation */
.main-nav{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.main-nav a{
  color: var(--text-on-dark);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform .08s ease, background-color .12s ease, border-color .12s ease;
}

.main-nav a:hover{
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212,166,90,.15);
  transform: translateY(-1px);
}

.main-nav a.active{
  background: var(--accent);
  color: #1c1208;
  border-color: var(--accent);
  font-weight: 700;
}

/* Make sure page content isn’t stuck under the sticky header */
main{ scroll-margin-top: 84px; }
:root{
  --logo-size: 120px;
  --logo-size-lg: 150px;
}

/* base logo rule (uses variables) */
.logo{
  margin: 0 auto 8px;
}
.logo img{
  height: var(--logo-size);
  width: auto;
  object-fit: contain;
  display: block;
}
@media (min-width: 900px){
  .logo img{ height: var(--logo-size-lg); }
}
/* card image presentation */
.card img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 8px;
}
/* Horse card image */
.card img{
  display: block;
  width: 100%;
  height: 220px;       /* you can adjust */
  object-fit: cover;
  object-position: center;
  background: #2b231d; /* shows behind SVG/data-URL placeholder */
  border-radius: 8px;
}
/* Profiles grid images */
.horse-card .thumb-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #1e1915;
  aspect-ratio: 4 / 3; /* keeps card height consistent */
}
.horse-card .thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* crop nicely */
  object-position: center;
}
.horse-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.horse-card .tag {
  display: inline-block;
  border: 1px solid #b08968;
  color: #f2e3c8;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  font-size: 12px;
  background: rgba(176,137,104,.08);
}
.horse-card { background: #201a15; border: 1px solid #6f5436; border-radius: 12px; padding: 12px; }
.horse-photo { width: 100%; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background:#2b241f; display:grid; place-items:center; }
.horse-photo img { width: 100%; height: 100%; object-fit: cover; display:block; }
.horse-head h3 { margin: 10px 0 6px; font-weight: 700; }
.chips { display:flex; gap:6px; flex-wrap: wrap; }
.chip { background:#3a2f25; color:#f4e6cf; border:1px solid #6f5436; padding:2px 8px; border-radius:999px; font-size:.85rem }
.pill { background:#2b241f; border:1px dashed #8c6c46; color:#f4e6cf; padding:2px 6px; border-radius:6px; font-size:.8rem }
.actions { display:flex; gap:8px; margin-top:10px }

.color-swatch {
  display:inline-block;
  width:1em; height:1em;
  border-radius:50%;
  border:1px solid #b08968;
  vertical-align:middle;
}

/* Ensure horse notes respect line breaks */
#horseNotes {
  white-space: pre-line;
}
/* --- Supabase Reset UI (minimal, neutral) --- */
.reset-backdrop {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.55);
  z-index: 9999;
}
.reset-card {
  width: min(480px, 92vw);
  background: #fff;
  color: #111827;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.reset-title { margin: 0 0 6px; font-size: 1.375rem; font-weight: 700; }
.reset-msg { margin: 0 0 18px; color: #374151; }
.reset-form { display: grid; gap: 12px; }
.reset-label { display: grid; gap: 6px; font-size: .95rem; color: #111827; }
.reset-input {
  padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 1rem;
  outline: none;
}
.reset-input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.2); }
.reset-actions { display: flex; gap: 10px; margin-top: 8px; }
.reset-btn-primary {
  appearance: none; border: 0; border-radius: 999px; padding: 10px 16px;
  background: #0ea5e9; color: white; font-weight: 600; cursor: pointer;
}
.reset-btn-primary:hover { filter: brightness(0.95); }
.reset-btn-ghost {
  appearance: none; border: 1px solid #cbd5e1; border-radius: 999px; padding: 10px 16px;
  background: white; color: #111827; font-weight: 600; cursor: pointer;
}
.reset-btn-ghost:hover { background: #f3f4f6; }
.reset-error { color: #b91c1c; }
.reset-success { color: #065f46; }
