:root {
  --gold: #d4af37;
  --gold2: #f3d77a;
  --bg: #0a0805;
  --text: #f7efe0;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Cairo", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(243,215,122,.22), transparent 40%),
    linear-gradient(180deg, rgba(8,6,3,.72), rgba(8,6,3,.92)),
    url('../img/hero-ref.png') center/cover no-repeat;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 0 20px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #3a2a08;
  background: radial-gradient(circle at 30% 30%, #fff3c4, var(--gold) 50%, #8a6a12);
  box-shadow: 0 0 0 3px rgba(243,215,122,.3), 0 10px 30px rgba(212,175,55,.35);
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 900;
}
.brand p {
  margin: 2px 0 0;
  opacity: .75;
  font-size: .95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243,215,122,.35);
  background: rgba(0,0,0,.45);
  font-weight: 800;
}
.badge i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #888;
  display: block;
}
.badge[data-status="live"] {
  color: #b9ffd4;
  border-color: rgba(80,220,140,.5);
}
.badge[data-status="live"] i {
  background: #31d07a;
  box-shadow: 0 0 0 0 rgba(49,208,122,.6);
  animation: pulse 1.2s infinite;
}
.badge[data-status="sold"] {
  color: var(--gold2);
}
.badge[data-status="sold"] i { background: var(--gold2); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(49,208,122,.55); }
  70% { box-shadow: 0 0 0 12px rgba(49,208,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(49,208,122,0); }
}

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: clamp(16px, 3vw, 28px);
  border-radius: 24px;
  border: 1px solid rgba(243,215,122,.3);
  background: linear-gradient(180deg, rgba(28,20,10,.88), rgba(10,8,5,.94));
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}

.title {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(243,215,122,.3);
  background: rgba(0,0,0,.35);
  font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  text-align: center;
}

.media {
  width: min(680px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
}

.photo {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(243,215,122,.3);
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.photo img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  background: #111;
}

/* Saudi official-style plate (US size: strip on the right) */
.ksa-plate {
  width: min(640px, 100%);
  aspect-ratio: 335 / 155;
  display: grid;
  grid-template-columns: 1fr 78px;
  border: 4px solid #111;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: #111;
  box-shadow:
    0 18px 45px rgba(0,0,0,.5),
    0 0 0 1px rgba(243,215,122,.25),
    0 0 36px rgba(212,175,55,.18);
}

.ksa-main {
  display: grid;
  grid-template-rows: 1fr 1fr;
  background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
  min-width: 0;
}

.ksa-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  min-width: 0;
}
.ksa-row-ar {
  border-bottom: 2px solid #111;
}
.ksa-cell {
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
  color: #111;
  padding: 4px 8px;
  min-width: 0;
}
.ksa-letters-ar,
.ksa-letters-en {
  border-left: 2px solid #111;
}

.ksa-letters-ar {
  font-family: "Cairo", "Traditional Arabic", Tahoma, sans-serif;
  font-size: clamp(1.55rem, 5vw, 2.7rem);
  letter-spacing: .22em;
  padding-inline-start: .22em;
}
.ksa-numbers-ar {
  font-family: "Cairo", Tahoma, sans-serif;
  font-size: clamp(1.7rem, 5.4vw, 2.9rem);
  letter-spacing: .18em;
  padding-inline-start: .18em;
}
.ksa-letters-en,
.ksa-numbers-en {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.35rem, 4.4vw, 2.35rem);
  letter-spacing: .28em;
  padding-inline-start: .28em;
  font-variant-numeric: tabular-nums;
}

.ksa-side {
  background: linear-gradient(180deg, #f4f4f4 0%, #e9e9e9 100%);
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 10px;
  border-left: 3px solid #111;
}
.ksa-emblem {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid #006C35;
}
.ksa-emblem svg { display: block; }
.ksa-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}
.ksa-en {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .12em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #111;
}
.ksa-ar {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #111;
}
.ksa-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #111;
  background: #fff;
}

@media (max-width: 640px) {
  .ksa-plate {
    grid-template-columns: 1fr 58px;
    border-width: 3px;
  }
  .ksa-en { font-size: 12px; }
  .ksa-ar { font-size: 10px; }
  .ksa-emblem { width: 30px; height: 30px; }
  .ksa-emblem svg { width: 20px; height: 20px; }
  .ksa-mark { width: 11px; height: 11px; }
}

.bid {
  width: min(520px, 100%);
  text-align: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(243,215,122,.3);
  background: rgba(0,0,0,.35);
}
.bid small {
  display: block;
  opacity: .7;
  font-weight: 700;
}
.bid strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 1.05;
  font-weight: 900;
  background: linear-gradient(180deg, #fff8dc, #f0d06a 45%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bid em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  opacity: .65;
  font-size: .95rem;
}
.bid.pop strong {
  animation: pop .4s ease;
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.winner {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 40%, rgba(243,215,122,.35), transparent 42%),
    rgba(5,4,3,.92);
}
.winner.on { display: grid; }
.winner-box {
  width: min(680px, 100%);
  text-align: center;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 24px;
  border: 1px solid rgba(243,215,122,.35);
  background: linear-gradient(180deg, rgba(40,30,14,.95), rgba(12,9,5,.98));
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: winIn .55s ease;
}
@keyframes winIn {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
.winner-box span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(243,215,122,.35);
  color: var(--gold2);
  font-weight: 800;
}
.winner-box h2 {
  margin: 10px 0 0;
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: .95;
  background: linear-gradient(180deg, #fff8dc, #f0d06a, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.winner-box p {
  margin: 10px 0 0;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
}
.winner-name {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e1a0, #d4af37 50%, #8a6a12);
  color: #241805;
  font-weight: 900;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
}
.winner-plate {
  margin-top: 10px;
  opacity: .7;
  font-weight: 700;
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.fx span {
  position: absolute;
  top: -10vh;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f6e27a, #8a6410);
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(120vh) rotate(640deg); opacity: .15; }
}

@media (max-width: 640px) {
  .logo { width: 50px; height: 50px; }
  .plate { border-width: 5px; }
  .card { gap: 14px; }
}
