/* Pony Auction — single-screen UI on top of paddock.
   Paper / ink / oxblood. JetBrains Mono throughout for chrome,
   Fraunces for the prompt itself (the buyer's words). */

.auc {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #14130f;
}

.auc > * { pointer-events: auto; }

/* ---------- START PILL (replaces the old play affordance) ---------- */

.auc-start {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #8a2a1e;
  color: #f3efe6;
  border: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font: 500 13px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 19, 15, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.auc-start:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 10px 28px rgba(20, 19, 15, 0.28); }
.auc-start:focus-visible { outline: 2px solid #14130f; outline-offset: 4px; }

.auc.is-running .auc-start { display: none; }

/* ---------- STAGE ---------- */

.auc-stage[aria-hidden="true"] { display: none; }
.auc-stage[aria-hidden="false"] { display: contents; }

/* TOP BAR — buyer prompt */
.auc-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(243, 239, 230, 0.94);
  border-bottom: 1px solid #14130f;
  padding: 1.1rem 1.5rem 0.9rem;
  backdrop-filter: blur(2px);
}

.auc-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: #6b6657;
  margin-bottom: 0.45rem;
}
.auc-buyer { color: #8a2a1e; }
.auc-count {}

.auc-prompt {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #14130f;
  font-feature-settings: "ss01";
  font-style: italic;
  max-width: 28ch;
}

.auc-timer {
  position: relative;
  height: 2px;
  margin: 0.85rem 0 0;
  background: rgba(20, 19, 15, 0.12);
  overflow: hidden;
}
.auc-timer__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  background: #8a2a1e;
  transition: width 80ms linear;
}
.auc-timer__fill.is-critical { animation: aucBlink 600ms steps(2, end) infinite; }
@keyframes aucBlink { 50% { opacity: 0.45; } }

/* BOTTOM BAR — pick / price / sell */
.auc-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(243, 239, 230, 0.94);
  border-top: 1px solid #14130f;
  padding: 0.95rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.auc-pick {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 200px;
  min-width: 200px;
}
.auc-pick__label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: #6b6657; }
.auc-pick__active {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: #14130f;
  text-transform: capitalize;
}
.auc-pick__hint { font-size: 11px; color: #6b6657; letter-spacing: 0.04em; }

.auc-price {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
}
.auc-price__label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b6657;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.auc-price__label > span {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0;
  color: #14130f;
  text-transform: none;
}
.auc-price input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}
.auc-price input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: #14130f;
}
.auc-price input[type="range"]::-moz-range-track {
  height: 2px; background: #14130f;
}
.auc-price input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #8a2a1e;
  border: 2px solid #f3efe6;
  margin-top: -8px;
  cursor: pointer;
}
.auc-price input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #8a2a1e;
  border: 2px solid #f3efe6;
  cursor: pointer;
}

.auc-submit {
  background: #8a2a1e;
  color: #f3efe6;
  border: none;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font: 500 13px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease;
}
.auc-submit:disabled {
  background: #d9d4c5;
  color: #6b6657;
  cursor: not-allowed;
}
.auc-submit:not(:disabled):hover { transform: translateY(-2px); }
.auc-submit:focus-visible { outline: 2px solid #14130f; outline-offset: 4px; }

.auc-score {
  position: fixed;
  top: 5.6rem;
  right: 1.5rem;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b6657;
}

/* RESULT FLASH ---------- */

.auc-result[aria-hidden="true"] { opacity: 0; pointer-events: none; }
.auc-result {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 220ms ease;
}
.auc-result__line {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 400;
  font-style: italic;
  color: #14130f;
  letter-spacing: -0.01em;
}
.auc-result__cash {
  margin-top: 0.4rem;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: #6b6657;
}
.auc-result.is-good .auc-result__cash { color: #8a2a1e; font-weight: 500; }
.auc-result.is-bad .auc-result__line { color: #6b6657; }

/* FINAL ---------- */

.auc-final[aria-hidden="true"] { display: none; }
.auc-final {
  position: fixed;
  inset: 0;
  background: rgba(243, 239, 230, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  z-index: 60;
}
.auc-final__title {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #6b6657;
}
.auc-final__total {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #14130f;
}
.auc-final__best {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: #6b6657;
}
.auc-final__btns { display: flex; gap: 0.7rem; margin-top: 1.2rem; }
.auc-btn {
  background: transparent;
  color: #14130f;
  border: 1px solid #14130f;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  cursor: pointer;
}
.auc-btn--primary { background: #8a2a1e; color: #f3efe6; border-color: #8a2a1e; }
.auc-btn:hover { transform: translateY(-2px); }
.auc-btn:focus-visible { outline: 2px solid #14130f; outline-offset: 4px; }

/* When auction is running, hide the chill chrome that competes for attention. */
body.is-auction .stamp,
body.is-auction .compass,
body.is-auction .fold,
body.is-auction .recall,
body.is-auction .mute,
body.is-auction .affordance,
body.is-auction .hint,
body.is-auction .witness {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* MOBILE ---------- */
@media (max-width: 600px) {
  .auc-top { padding: 0.85rem 1rem 0.7rem; }
  .auc-bottom { padding: 0.7rem 1rem; gap: 0.8rem; }
  .auc-prompt { font-size: 1.3rem; }
  .auc-pick__active { font-size: 1.1rem; }
  .auc-score { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auc-timer__fill,
  .auc-result,
  .auc-start,
  .auc-submit,
  .auc-btn { transition: none; }
  .auc-timer__fill.is-critical { animation: none; opacity: 0.7; }
}
