/* ============================================================
   오리 레이스 — 기존 V3 스타일시트 이식본
   · 애니메이션/제스처/장식 규칙은 V3 원본 그대로 (동작 동일)
   · 색상·테두리·그림자·타이포만 Go-Go! Duck 디자인 토큰으로 교체
   dr- 접두사만 사용 — 다른 화면에는 영향 없음
   ============================================================ */

.dr-page { max-width: 900px; margin-left: auto; margin-right: auto; }

.dr-card { padding: 24px 26px 22px; }

/* ---------- 헤더 (제목 + 참가비/상금풀) ---------- */
.dr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dr-title-wrap { display: flex; align-items: center; gap: 12px; }

.dr-title-duck {
  width: 52px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: drTitleBob 1.6s ease-in-out infinite;
}
@keyframes drTitleBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.dr-title {
  margin: 0 0 3px;
  font-size: 23px;
  font-weight: 900;
  color: var(--tx);
  letter-spacing: -0.3px;
}

.dr-sub { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }

.dr-stats { display: flex; gap: 8px; flex-wrap: wrap; }

.dr-stat {
  min-width: 92px;
  padding: 9px 13px;
  border-radius: 13px;
  border: 1px solid var(--card-border);
  background: #f5faff;
  text-align: center;
}
.dr-stat span { display: block; font-size: 10.5px; font-weight: 800; color: var(--tx-sub); margin-bottom: 3px; }
.dr-stat b { font-size: 15px; font-weight: 900; color: var(--tx); font-variant-numeric: tabular-nums; }
.dr-stat b i { font-style: normal; }

.dr-stat.is-pot { border-color: #ffe0a8; background: linear-gradient(180deg, #fff9ec, #fff3dc); }
.dr-stat.is-pot b { color: #d98c07; }

/* ---------- 경주장 ---------- */
.dr-track {
  position: relative;
  background: #f7fbff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 8px 0 2px;
  overflow: hidden;
  min-height: 96px;
}

.dr-lanes { display: flex; flex-direction: column; }

.dr-lane {
  position: relative;
  height: 64px;
  border-bottom: 2px dashed #d6e4f3;
}
.dr-lane:last-child { border-bottom: none; }

.dr-duck {
  position: absolute;
  left: 0;
  top: 4px;
  width: 64px;
  will-change: transform;
}

.dr-duck-img {
  width: 34px;
  height: auto;
  image-rendering: pixelated;
  display: block;
  margin-left: 8px;
}

.dr-label {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-align: center;
  width: 52px;
}
.dr-rank { color: var(--tx-sub); margin-right: 1px; font-weight: 800; }
.dr-rank.is-final { color: var(--tx); font-weight: 900; }
.dr-label b { font-weight: 900; }

/* 말풍선 */
.dr-bubble {
  position: absolute;
  top: 2px;
  left: 0;
  padding: 4px 9px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(20, 45, 90, .10);
  font-size: 12px;
  font-weight: 800;
  color: var(--tx);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  z-index: 5;
  will-change: transform;
}
.dr-bubble::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -5px;
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom: none;
  filter: drop-shadow(0 1px 0 var(--card-border));
}
.dr-bubble.is-left::after { left: auto; right: 10px; }
.dr-bubble.show { opacity: 1; }

/* 카운트다운 (경주장 내부 중앙) */
.dr-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  font-weight: 900;
  color: var(--blue);
  text-shadow: 0 2px 0 #fff;
  background: rgba(247, 251, 255, .5);
  z-index: 10;
  pointer-events: none;
}
.dr-count[hidden] { display: none; }   /* hidden 속성이 display:flex 에 밀리지 않게 */
.dr-count.pop { animation: drCountPop .55s ease-out; }
@keyframes drCountPop {
  0%   { transform: scale(1.5); opacity: .3; }
  100% { transform: scale(1); opacity: 1; }
}

.dr-track-hint {
  padding: 30px 10px 32px;
  text-align: center;
  color: var(--tx-sub);
  font-size: 13.5px;
  font-weight: 700;
}

/* 자동 시작 카운트다운 배지 */
.dr-autostart {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 11;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(37, 110, 235, .3);
}
.dr-autostart[hidden] { display: none; }
.dr-autostart b { font-size: 14px; font-weight: 900; }


/* ============================================================
   오리 상태 연출 — V3 원본 그대로
   ============================================================ */

/* 부스트: 앞으로 기울고 빠르게 통통 + 속도선 */
.dr-duck.is-boost .dr-duck-img,
.dr-duck.dr-g-boost .dr-duck-img { animation: drBoostBob .22s linear infinite; }
@keyframes drBoostBob {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50%      { transform: rotate(7deg) translateY(-3px); }
}
.dr-lines { position: absolute; left: -26px; top: 12px; width: 26px; opacity: 0; }
.dr-lines i {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: #9fd7f0;
}
.dr-lines i:nth-child(2) { width: 70%; background: var(--gold); }
.dr-lines i:nth-child(3) { width: 85%; }
.dr-duck.is-boost .dr-lines,
.dr-duck.dr-g-boost .dr-lines { opacity: 1; animation: drLinesFlow .3s linear infinite; }
@keyframes drLinesFlow {
  from { transform: translateX(6px); opacity: 1; }
  to   { transform: translateX(-8px); opacity: .4; }
}
.dr-duck.dr-g-boost .dr-duck-img  { filter: drop-shadow(0 0 6px rgba(255, 205, 90, .8)); }
.dr-duck.dr-g-boost2 .dr-duck-img { filter: drop-shadow(0 0 9px rgba(255, 170, 60, .9)); }
.dr-boost-tag {
  position: absolute;
  left: -34px;
  top: -8px;
  font-size: 10px;
  font-weight: 900;
  color: #f39c12;
  letter-spacing: .5px;
}

/* 제스처 */
.dr-duck.dr-g-wobble .dr-duck-img { animation: drWobble .5s ease-in-out infinite; }
@keyframes drWobble { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.dr-duck.dr-g-shakehead .dr-duck-img { animation: drWobble .7s ease-in-out infinite; }
.dr-duck.dr-g-lookdown .dr-duck-img { transform: rotate(14deg); }
.dr-duck.dr-g-sit .dr-duck-img { transform: translateY(5px) scaleY(.82); }
.dr-duck.dr-g-dim .dr-duck-img { filter: brightness(.55); }
.dr-duck.dr-g-saver .dr-duck-img { filter: saturate(.25) brightness(.85); }
.dr-duck.dr-g-lookback .dr-duck-img { animation: drLookBack 1.2s ease-in-out; }
@keyframes drLookBack {
  0%, 100%  { transform: scaleX(1); }
  25%, 65%  { transform: scaleX(-1); }
}
.dr-duck.dr-g-hop .dr-duck-img { animation: drHop .5s ease-out 2; }
@keyframes drHop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.dr-duck.dr-g-lookup .dr-duck-img { transform: rotate(-12deg); }
.dr-duck.dr-g-wave .dr-duck-img { animation: drWave .4s ease-in-out 3; }
@keyframes drWave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-8deg) translateY(-2px); } }
.dr-duck.dr-g-headdown .dr-duck-img { transform: rotate(9deg) translateY(2px); }
.dr-duck.is-finished .dr-duck-img { animation: drHop .6s ease-out 2; }

/* 장식(머리 위 아이콘) */
.dr-acc { position: absolute; left: 12px; top: -14px; height: 14px; pointer-events: none; }
.dr-acc-txt { font-size: 13px; font-weight: 900; color: #e67e22; }
.dr-acc-star { font-size: 12px; color: #f1c40f; text-shadow: 0 0 4px rgba(241, 196, 15, .7); }
.dr-acc-bat { font-size: 9px; font-weight: 900; color: #e74c3c; border: 1px solid #e74c3c; border-radius: 2px; padding: 0 2px; background: #fff; }
.dr-acc-dots i, .dr-acc-bub i {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #8a9099;
  margin-right: 2px;
  animation: drBlink2 1s infinite;
}
.dr-acc-dots i:nth-child(2) { animation-delay: .2s; }
.dr-acc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes drBlink2 { 50% { opacity: .2; } }
.dr-acc-bub i { background: #aadcf5; border-radius: 50%; animation: drBubUp 1s infinite; }
.dr-acc-bub i:nth-child(2) { width: 3px; height: 3px; animation-delay: .3s; }
@keyframes drBubUp { from { transform: translateY(2px); opacity: 1; } to { transform: translateY(-6px); opacity: 0; } }
.dr-acc-tear { display: inline-block; width: 4px; height: 6px; background: #6fb9ea; border-radius: 50% 50% 60% 60%; animation: drBubUp 1.1s infinite reverse; }
.dr-acc-flame i {
  display: inline-block;
  width: 5px; height: 8px;
  margin-right: 1px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #ffb54d, #ff5c2e);
  animation: drFlame .3s ease-in-out infinite alternate;
}
.dr-acc-flame i:nth-child(2) { height: 10px; animation-delay: .1s; }
@keyframes drFlame { from { transform: scaleY(1); } to { transform: scaleY(1.35); } }

.dr-confetti {
  position: absolute;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  pointer-events: none;
}

/* ---------- 하단 ---------- */
.dr-divider { height: 1px; background: #eef4fb; margin: 18px 0 14px; }

.dr-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dr-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }
.dr-dot { width: 8px; height: 8px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 6px rgba(53, 208, 127, .6); }
.dr-dot.is-off { background: #e74c3c; box-shadow: none; }
.dr-phase { color: var(--blue); font-weight: 900; margin-left: 4px; }
.dr-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-me { font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }
.dr-me b { color: var(--tx); font-weight: 900; }
.dr-hint { font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }

.dr-btn {
  height: 40px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--tx);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s;
}
.dr-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.dr-btn-primary {
  background: linear-gradient(180deg, #3b86fa, #1d6bfa);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(29, 107, 250, .28);
}
.dr-btn-primary:hover { color: #fff; filter: brightness(1.05); }

.dr-admin {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  background: #f5faff;
  border: 1px solid var(--card-border);
  border-radius: 13px;
}
.dr-admin[hidden] { display: none; }   /* hidden 속성이 display:flex 에 밀리지 않게 */
.dr-admin-label {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
}
.dr-admin .dr-btn { height: 34px; padding: 0 14px; font-size: 12.5px; }

.dr-guide {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--tx-sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.9;
}
.dr-guide b { color: var(--tx); font-weight: 900; }

/* ---------- 결과 팝업 ---------- */
.dr-pop-back {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(120, 160, 195, .3);
  backdrop-filter: blur(2px);
}
.dr-pop {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 24px 22px 20px;
  box-shadow: 0 18px 46px rgba(20, 45, 90, .24);
  animation: drPopIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes drPopIn { from { transform: scale(.7); opacity: 0; } }
.dr-pop h3 { text-align: center; color: var(--tx); font-size: 20px; font-weight: 900; margin: 0 0 14px; }

.dr-pop-prize {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f5faff;
  border: 1px solid var(--card-border);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--tx-sub);
}
.dr-pop-prize b { color: #d98c07; font-weight: 900; }
.dr-pop-prize.is-win {
  background: linear-gradient(180deg, #fff9ec, #fff1d6);
  border-color: #f5d98a;
  color: #a8620f;
  font-size: 14px;
}

.dr-pop-list { display: flex; flex-direction: column; gap: 6px; max-height: 44vh; overflow-y: auto; }
.dr-pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f8fbfe;
  border: 1px solid #eef4fb;
  border-radius: 11px;
  font-size: 13.5px;
}
.dr-pop-row b { color: var(--tx-sub); min-width: 34px; font-weight: 900; }
.dr-pop-row span { flex: 1; font-weight: 900; }
.dr-pop-row i { font-style: normal; color: var(--tx-sub); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dr-pop-row em { font-style: normal; }
.dr-pop-row.is-winner { background: #fff8e6; border-color: #f5d98a; }
.dr-pop-row.is-winner b { color: #d4930d; }
.dr-pop-btns { display: flex; gap: 9px; justify-content: center; margin-top: 16px; }
