@font-face {
  font-family: "system-display";
  src: local("Arial");
}

:root {
  --cafe: #4a2c17;
  --verde: #2d6a1f;
  --rojo: #8b1a1a;
  --crema: #f5f0e8;
  --white: #ffffff;
}

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

html,
body {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--white);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--cafe);
}

.hidden {
  display: none !important;
}

#screen {
  width: 1920px;
  height: 1080px;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

/* ---------------- Header ---------------- */

#header {
  height: 190px;
  background: var(--white);
  border-bottom: 6px solid var(--cafe);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 60px;
}

#logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 90px;
}

#logos img {
  height: 110px;
  width: auto;
  max-width: 560px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

#auctionName {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cafe);
  opacity: 0.8;
  text-align: center;
  max-width: 1700px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- Waiting state ---------------- */

#waiting {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#waiting p {
  font-size: 54px;
  font-weight: 700;
  color: var(--cafe);
  opacity: 0.6;
}

/* ---------------- Stage layout ---------------- */

#stage {
  flex: 1;
  display: grid;
  grid-template-columns: 26fr 48fr 26fr;
  column-gap: 48px;
  height: calc(1080px - 190px);
}

#colLeft,
#colCenter,
#colRight {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 36px;
  overflow: hidden;
}

#colLeft {
  border-right: 3px solid var(--crema);
  justify-content: center;
}

#colRight {
  border-left: 3px solid var(--crema);
  justify-content: flex-start;
  padding-top: 60px;
}

/* ---------------- Left: photo frame ---------------- */

.frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 780px;
  background: var(--crema);
  border: 14px solid var(--cafe);
  border-radius: 12px;
  box-shadow:
    0 0 0 6px var(--white),
    0 0 0 10px var(--rojo),
    0 18px 40px rgba(74, 44, 23, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid rgba(45, 106, 31, 0.5);
  border-radius: 4px;
  pointer-events: none;
  margin: 14px;
}

#lotName {
  margin-top: 34px;
  font-size: 42px;
  font-weight: 800;
  text-align: center;
  color: var(--cafe);
  line-height: 1.15;
  max-width: 100%;
}

/* ---------------- Center: bid ---------------- */

#colCenter {
  justify-content: center;
  position: relative;
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Keep all readable content above the confetti layer so it never
   obstructs the number, even while falling "over" the column. */
#bidLabel,
#bidAmount,
#bidderName,
#timer {
  position: relative;
  z-index: 2;
}

#extendedBadge {
  position: absolute;
  z-index: 2;
  top: 8px;
  padding: 10px 28px;
  background: var(--rojo);
  color: var(--white);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-radius: 999px;
  animation: pulse-badge 1s ease-in-out infinite;
}

#bidLabel {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--verde);
  margin-bottom: 6px;
}

#bidAmount {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 200px;
  font-weight: 900;
  line-height: 1;
  color: var(--cafe);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: transform 0.15s ease-out;
  position: relative;
  z-index: 2;
}

#bidSymbol {
  font-size: 0.5em;
  vertical-align: 0.18em;
  margin-right: 8px;
  color: var(--rojo);
  font-weight: 700;
}

#bidAmount.bump {
  animation: bump 0.6s ease-out;
}

#bidderName {
  margin-top: 24px;
  font-size: 56px;
  font-weight: 700;
  color: var(--rojo);
  text-align: center;
  max-width: 90%;
}

#bidderName.bump {
  animation: bump 0.6s ease-out;
}

#timer {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 60px;
  border-radius: 20px;
  background: var(--crema);
  border: 4px solid var(--verde);
}

#timer.urgent {
  border-color: var(--rojo);
  background: #fbeaea;
  animation: pulse-timer 1s ease-in-out infinite;
}

#timer.expired {
  border-color: var(--rojo);
  background: var(--rojo);
}

#timer.expired #timerLabel,
#timer.expired #timerValue {
  color: var(--white);
}

#timerLabel {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--cafe);
  margin-bottom: 8px;
}

#timerValue {
  font-size: 90px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--cafe);
}

/* ---------------- Right: recent bids ---------------- */

#recentLabel {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--verde);
  margin-bottom: 30px;
  text-align: center;
}

#recentList {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

#recentList li {
  display: flex;
  flex-direction: column;
  padding: 20px 26px;
  border-radius: 14px;
  background: var(--crema);
  border-left: 8px solid var(--cafe);
  box-shadow: 0 6px 14px rgba(74, 44, 23, 0.14);
}

#recentList li:first-child {
  border-left-color: var(--rojo);
  background: #fdf3ee;
  box-shadow: 0 8px 18px rgba(139, 26, 26, 0.16);
}

#recentList .amount {
  font-size: 46px;
  font-weight: 800;
  color: var(--cafe);
  font-variant-numeric: tabular-nums;
}

#recentList li:first-child .amount {
  color: var(--rojo);
}

#recentList .name {
  font-size: 28px;
  font-weight: 600;
  color: var(--verde);
  margin-top: 4px;
}

#recentList .empty {
  font-size: 28px;
  font-weight: 600;
  color: var(--cafe);
  opacity: 0.5;
  text-align: center;
}

/* ---------------- Animations ---------------- */

@keyframes bump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.08);
    color: var(--verde);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse-timer {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(139, 26, 26, 0.4);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(139, 26, 26, 0);
  }
}

@keyframes pulse-badge {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
