/* ===== 오리 레이스 V3 (Go-Go! Duck Roulette 스타일) =====
   밝은 하늘색 배경 + 흰색 카드 + 연회색 경주장 + 픽셀 오리.
   drv3- 접두사만 사용 — 기존 화면에는 영향 없음. */

.drv3-page {
  min-height: 100vh;
  padding: 36px 16px 70px;
  background: #eef8ff;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Malgun Gothic", sans-serif;
  color: #3a4148;
}

.drv3-card {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 30px 30px 26px;
  box-shadow: 0 10px 34px rgba(90, 140, 190, 0.14);
}

.drv3-title {
  text-align: center;
  color: #1b7f9e;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 4px 0 26px;
}

/* ---------- 경주장 ---------- */

.drv3-track {
  position: relative;
  background: #fafafa;
  border: 1px solid #e4e4e9;
  border-radius: 12px;
  padding: 8px 0 2px;
  overflow: hidden;
}

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

.drv3-lane {
  position: relative;
  height: 64px;
  border-bottom: 2px dashed #cfcfd6;
}

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

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

.drv3-label {
  margin-top: 1px;
  font-size: 12.5px;
  white-space: nowrap;
  text-align: center;
  width: 52px;
}
.drv3-rank { color: #9aa1a8; margin-right: 1px; }
.drv3-rank.is-final { color: #6b7280; font-weight: 700; }
.drv3-label b { font-weight: 700; }

/* 말풍선 */
.drv3-bubble {
  position: absolute;
  top: 2px;
  left: 0;
  padding: 4px 9px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 5;
  will-change: transform;
}
.drv3-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 #ddd);
}
.drv3-bubble.is-left::after { left: auto; right: 10px; }
.drv3-bubble.show { opacity: 1; }

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

.drv3-track-hint {
  padding: 26px 10px 30px;
  text-align: center;
  color: #9aa1a8;
  font-size: 14px;
}

/* ---------- 오리 상태 연출 ---------- */

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

/* 제스처 */
.drv3-duck.drv3-g-wobble .drv3-duck-img { animation: drv3Wobble 0.5s ease-in-out infinite; }
@keyframes drv3Wobble { 0%,100%{transform:rotate(-4deg)} 50%{transform:rotate(4deg)} }
.drv3-duck.drv3-g-shakehead .drv3-duck-img { animation: drv3Wobble 0.7s ease-in-out infinite; }
.drv3-duck.drv3-g-lookdown .drv3-duck-img { transform: rotate(14deg); }
.drv3-duck.drv3-g-sit .drv3-duck-img { transform: translateY(5px) scaleY(0.82); }
.drv3-duck.drv3-g-dim .drv3-duck-img { filter: brightness(0.55); }
.drv3-duck.drv3-g-saver .drv3-duck-img { filter: saturate(0.25) brightness(0.85); }
.drv3-duck.drv3-g-lookback .drv3-duck-img { animation: drv3LookBack 1.2s ease-in-out; }
@keyframes drv3LookBack {
  0%, 100% { transform: scaleX(1); }
  25%, 65% { transform: scaleX(-1); }
}
.drv3-duck.drv3-g-hop .drv3-duck-img { animation: drv3Hop 0.5s ease-out 2; }
@keyframes drv3Hop { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.drv3-duck.drv3-g-lookup .drv3-duck-img { transform: rotate(-12deg); }
.drv3-duck.drv3-g-wave .drv3-duck-img { animation: drv3Wave 0.4s ease-in-out 3; }
@keyframes drv3Wave { 0%,100%{transform:rotate(0)} 50%{transform:rotate(-8deg) translateY(-2px)} }
.drv3-duck.drv3-g-headdown .drv3-duck-img { transform: rotate(9deg) translateY(2px); }
.drv3-duck.is-finished .drv3-duck-img { animation: drv3Hop 0.6s ease-out 2; }

/* 장식(머리 위 아이콘) */
.drv3-acc { position: absolute; left: 12px; top: -14px; height: 14px; pointer-events: none; }
.drv3-acc-txt { font-size: 13px; font-weight: 800; color: #e67e22; }
.drv3-acc-star { font-size: 12px; color: #f1c40f; text-shadow: 0 0 4px rgba(241, 196, 15, 0.7); }
.drv3-acc-bat { font-size: 9px; font-weight: 800; color: #e74c3c; border: 1px solid #e74c3c; border-radius: 2px; padding: 0 2px; background: #fff; }
.drv3-acc-dots i, .drv3-acc-bub i {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #8a9099;
  margin-right: 2px;
  animation: drv3Blink2 1s infinite;
}
.drv3-acc-dots i:nth-child(2) { animation-delay: 0.2s; }
.drv3-acc-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes drv3Blink2 { 50% { opacity: 0.2; } }
.drv3-acc-bub i { background: #aadcf5; border-radius: 50%; animation: drv3BubUp 1s infinite; }
.drv3-acc-bub i:nth-child(2) { width: 3px; height: 3px; animation-delay: 0.3s; }
@keyframes drv3BubUp { from { transform: translateY(2px); opacity: 1; } to { transform: translateY(-6px); opacity: 0; } }
.drv3-acc-tear { display: inline-block; width: 4px; height: 6px; background: #6fb9ea; border-radius: 50% 50% 60% 60%; animation: drv3BubUp 1.1s infinite reverse; }
.drv3-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: drv3Flame 0.3s ease-in-out infinite alternate;
}
.drv3-acc-flame i:nth-child(2) { height: 10px; animation-delay: 0.1s; }
@keyframes drv3Flame { from { transform: scaleY(1); } to { transform: scaleY(1.35); } }

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

/* ---------- 하단 ---------- */

.drv3-divider { height: 1px; background: #e8e8ee; margin: 20px 0 14px; }

.drv3-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.drv3-status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #8a9099; }
.drv3-dot { width: 8px; height: 8px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 6px rgba(53, 208, 127, 0.6); }
.drv3-dot.is-off { background: #e74c3c; box-shadow: none; }
.drv3-phase { color: #1b7f9e; font-weight: 700; margin-left: 4px; }
.drv3-actions { display: flex; align-items: center; gap: 10px; }
.drv3-me { font-size: 13px; color: #6b7280; }
.drv3-hint { font-size: 13px; color: #9aa1a8; }

.drv3-btn {
  padding: 9px 16px;
  background: #ffffff;
  border: 1px solid #d7dbe0;
  border-radius: 9px;
  color: #4a525a;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}
.drv3-btn:hover { border-color: #1b7f9e; color: #1b7f9e; transform: translateY(-1px); }
.drv3-btn-primary {
  background: #2b9cbf;
  border-color: #2b9cbf;
  color: #fff;
  box-shadow: 0 4px 12px rgba(43, 156, 191, 0.28);
}
.drv3-btn-primary:hover { background: #2189aa; color: #fff; }

.drv3-admin {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 13px 14px;
  background: #f6fafc;
  border: 1px solid #e2ecf2;
  border-radius: 11px;
}
.drv3-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #6b7280; font-weight: 600; }
.drv3-opt select {
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: 7px;
  font-size: 13px;
  color: #3a4148;
  font-weight: 700;
}
.drv3-check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #6b7280; font-weight: 600; cursor: pointer; }
.drv3-check input { accent-color: #2b9cbf; width: 15px; height: 15px; }

/* ---------- 결과 팝업 ---------- */

.drv3-pop-back {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 160, 195, 0.28);
  backdrop-filter: blur(2px);
}
.drv3-pop {
  width: min(380px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 24px 22px 20px;
  box-shadow: 0 16px 44px rgba(60, 100, 140, 0.25);
  animation: drv3PopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes drv3PopIn { from { transform: scale(0.7); opacity: 0; } }
.drv3-pop h3 { text-align: center; color: #1b7f9e; font-size: 21px; margin-bottom: 16px; }
.drv3-pop-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.drv3-pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafb;
  border: 1px solid #eceff2;
  border-radius: 9px;
  font-size: 14px;
}
.drv3-pop-row b { color: #6b7280; min-width: 34px; }
.drv3-pop-row span { flex: 1; font-weight: 700; }
.drv3-pop-row i { font-style: normal; color: #9aa1a8; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.drv3-pop-row.is-winner {
  background: #fff8e6;
  border-color: #f5d98a;
}
.drv3-pop-row.is-winner b { color: #d4930d; }
.drv3-pop-btns { display: flex; gap: 9px; justify-content: center; margin-top: 16px; }

/* ---------- 반응형 ---------- */

@media (max-width: 620px) {
  .drv3-title { font-size: 29px; }
  .drv3-card { padding: 20px 14px 18px; }
  .drv3-lane { height: 58px; }
  .drv3-count { font-size: 44px; }
  .drv3-admin { gap: 8px; }
}

/* BGM 토글 (카드 우측 상단) */
.drv3-bgm-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4f9fc;
  border: 1px solid #dbe6ee;
  font-size: 17px;
  cursor: pointer;
  transition: 0.15s;
}
.drv3-bgm-toggle:hover { border-color: #2b9cbf; transform: translateY(-1px); }
