@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap');

/* ===== CSS O'ZGARUVCHILAR ===== */
:root {
  --theme-color: #D4AF37;
  --accent-color: #ffffff;
  --theme-rgb: 212, 175, 55;
  --accent-rgb: 255, 255, 255;
  --bg-opacity: 0.42;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body {
  background-color: transparent;
  font-family: 'Montserrat', sans-serif;
  color: var(--accent-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 12px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Asosiy Konteyner */
.marathon-container {
  background: rgba(20, 20, 22, 0.96);
  padding: clamp(18px, 4vw, 35px) clamp(16px, 5vw, 45px) clamp(16px, 3vw, 30px);
  border-radius: clamp(18px, 3vw, 32px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.7), 0 0 0 2px rgba(var(--theme-rgb), 0.15);
  text-align: center;
  max-width: 850px;
  width: 100%;
}

/* Sarlavhalar */
.header-section {
  margin-bottom: clamp(12px, 2vw, 20px);
}

.title-main {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 800;
  margin: 0;
  letter-spacing: clamp(1px, 0.4vw, 3px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-color) 60%, white) 0%, var(--theme-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-sub {
  font-size: clamp(18px, 4vw, 36px);
  font-weight: 800;
  margin: 5px 0 0 0;
  color: var(--theme-color);
  letter-spacing: clamp(1px, 0.3vw, 2px);
}

.qoldi-text {
  font-size: clamp(12px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: clamp(3px, 1vw, 8px);
  margin-top: clamp(-10px, -1.5vw, -18px);
  margin-bottom: clamp(12px, 2vw, 22px);
  text-transform: uppercase;
  opacity: 0.9;
  text-align: center;
}

/* ===== ASOSIY TAYMER ===== */
.main-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: clamp(16px, 3vw, 30px) 0;
  width: 100%;
  flex-wrap: wrap;
  gap: 4px;
}

/* Timer box */
.timer-box {
  position: relative;
  background: linear-gradient(135deg, #232329 0%, #17171a 100%);
  border-radius: clamp(14px, 2vw, 22px);
  padding: clamp(8px, 1.5vw, 15px) clamp(10px, 2vw, 25px);
  min-width: clamp(70px, 14vw, 130px);
  flex-shrink: 0;
  border: 3px solid transparent;
  background-clip: padding-box;
  z-index: 0;
  overflow: hidden;
}

/* Yaltiragan border effekti */
.timer-box::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: clamp(16px, 2.5vw, 24px);
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    var(--theme-color) 60deg,
    rgba(var(--theme-rgb), 0.8) 120deg,
    transparent 180deg,
    transparent 360deg
  );
  z-index: -1;
  animation: spin-border 3s linear infinite;
}

/* Border ichidagi qora fon */
.timer-box::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: clamp(12px, 1.8vw, 20px);
  background: linear-gradient(135deg, #232329 0%, #17171a 100%);
  z-index: -1;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin-border {
  from { --angle: 0deg; }
  to   { --angle: 360deg; }
}

/* Inner glow */
.timer-box span {
  display: block;
  font-size: clamp(36px, 8vw, 76px);
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1.1;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 20px rgba(var(--theme-rgb), 0.4);
}

.timer-box label {
  display: block;
  font-size: clamp(10px, 1.5vw, 16px);
  font-weight: 700;
  color: rgba(var(--accent-rgb), 0.6);
  margin-top: 5px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.colon {
  font-size: clamp(28px, 5.5vw, 54px);
  font-weight: 800;
  color: var(--theme-color);
  margin: 0 clamp(4px, 1vw, 15px);
  animation: blink 1s infinite;
  line-height: 1;
  flex-shrink: 0;
}

.timer-arrow {
  font-size: clamp(18px, 3.5vw, 36px);
  color: var(--theme-color);
  margin: 0 clamp(8px, 1.5vw, 20px);
  animation: pulse 1.5s infinite alternate;
  flex-shrink: 0;
}

/* Ma'lumotlar paneli */
.info-section {
  background: rgba(var(--theme-rgb), 0.08);
  border-radius: clamp(14px, 2.5vw, 24px);
  padding: clamp(12px, 2vw, 20px) clamp(12px, 3vw, 30px);
  margin-bottom: clamp(16px, 2.5vw, 30px);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(6px, 1vw, 10px) 0;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.status-live {
  font-size: clamp(16px, 3vw, 28px);
  color: var(--theme-color);
  font-weight: 800;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.live-icon {
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(10px, 1.5vw, 16px);
  background-color: #ff4a4a;
  border-radius: 50%;
  display: inline-block;
  margin-right: clamp(8px, 1.5vw, 15px);
  box-shadow: 0 0 14px #ff4a4a;
  animation: live-blink 1s infinite;
  flex-shrink: 0;
}

.live-counter {
  display: flex;
  align-items: center;
  font-size: clamp(22px, 4.5vw, 40px);
  font-weight: 800;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
}

.live-counter div {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 clamp(3px, 0.8vw, 8px);
}

.live-counter span {
  color: var(--accent-color);
  line-height: 1;
}

.live-counter label {
  font-size: clamp(10px, 1.3vw, 15px);
  font-weight: 800;
  color: rgba(var(--accent-rgb), 0.6);
  margin-top: 4px;
}

.mini-colon {
  font-size: clamp(18px, 3.5vw, 32px);
  font-weight: 800;
  color: rgba(var(--theme-rgb), 0.5);
  margin-top: -5px;
}

.divider {
  border: 0;
  height: 2px;
  background: rgba(var(--theme-rgb), 0.2);
  margin: clamp(6px, 1vw, 10px) 0;
}

.action-text {
  font-size: clamp(14px, 3vw, 28px);
  font-weight: 800;
  color: var(--theme-color);
  text-align: left;
  flex-shrink: 0;
}

.price-text {
  font-size: clamp(16px, 3.5vw, 32px);
  font-weight: 800;
  text-align: right;
  flex-shrink: 0;
  color: var(--accent-color);
}

.sub-price {
  display: block;
  font-size: clamp(11px, 1.8vw, 18px);
  color: var(--theme-color);
  font-weight: 700;
  margin-top: 4px;
}

/* Jami donat qismi */
.donation-section {
  width: 100%;
}

.donation-box {
  border: 3px solid var(--theme-color);
  border-radius: 60px;
  padding: clamp(10px, 1.5vw, 15px) clamp(22px, 5vw, 50px);
  font-size: clamp(26px, 5.5vw, 48px);
  font-weight: 800;
  display: inline-block;
  background: rgba(var(--theme-rgb), 0.07);
  box-shadow: 0 0 25px rgba(var(--theme-rgb), 0.2);
  color: var(--accent-color);
  max-width: 100%;
}

.currency {
  color: var(--theme-color);
}

.support-footer {
  font-size: clamp(11px, 1.8vw, 18px);
  font-weight: 700;
  color: rgba(var(--accent-rgb), 0.5);
  margin-top: 15px;
  letter-spacing: clamp(1px, 0.4vw, 3px);
  word-break: break-word;
}

/* ===== OXIRGI DONAT BLOKI ===== */
.last-donation-wrapper {
  margin-top: clamp(12px, 1.8vw, 18px);
  width: 100%;
}

.last-donation-box {
  background: rgba(var(--theme-rgb), 0.07);
  border: 2px solid rgba(var(--theme-rgb), 0.25);
  border-radius: clamp(12px, 2vw, 20px);
  padding: clamp(10px, 1.6vw, 16px) clamp(14px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 1.5vw, 20px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

/* Yangi donat kelganda yaltirash */
.last-donation-box.flash {
  border-color: var(--theme-color);
  box-shadow: 0 0 22px rgba(var(--theme-rgb), 0.45);
  animation: flash-glow 1.2s ease-out;
}

@keyframes flash-glow {
  0%   { box-shadow: 0 0 0px rgba(var(--theme-rgb), 0); }
  30%  { box-shadow: 0 0 32px rgba(var(--theme-rgb), 0.7); }
  100% { box-shadow: 0 0 12px rgba(var(--theme-rgb), 0.15); }
}

.last-donor {
  font-size: clamp(18px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--accent-color);
  max-width: min(340px, 45vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-sep {
  font-size: clamp(16px, 3vw, 28px);
  font-weight: 800;
  color: rgba(var(--theme-rgb), 0.5);
}

.last-amount {
  font-size: clamp(18px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--theme-color);
  white-space: nowrap;
}

.last-currency {
  font-size: clamp(13px, 2.2vw, 22px);
  font-weight: 700;
  opacity: 0.85;
}

/* --- ANIMATSIYALAR --- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@keyframes live-blink {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

@keyframes pulse {
  0% { transform: translateX(0); opacity: 0.5; }
  100% { transform: translateX(8px); opacity: 1; }
}

/* ===== MEDIA QUERIES ===== */

/* Tablets */
@media (max-width: 680px) {
  .timer-arrow {
    display: none;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .live-counter {
    justify-content: flex-start;
  }

  .price-text {
    text-align: left;
  }
}

/* Small phones */
@media (max-width: 400px) {
  body {
    padding: 10px 8px;
  }

  .marathon-container {
    border-radius: 18px;
  }

  .main-timer {
    gap: 2px;
  }

  .colon {
    margin: 0 2px;
  }

  .donation-box {
    padding: 10px 18px;
    word-break: break-all;
  }

  .last-donor {
    max-width: 55vw;
  }
}
