/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

:root {
  --bg-primary: #0d0d0d;
  --bg-card: #161618;
  --bg-overlay: rgba(0, 0, 0, 0.85);
  --text-primary: #f5f5f5;
  --text-secondary: #8a8a8e;
  --hot-color: #e53935;
  --not-color: #5a5a5e;
  --accent: #ef4444;
  --bar-bg: #242428;
  --rank-up: #4ade80;
  --rank-down: #e53935;
  --party-democrat: #2563eb;
  --party-people: #dc2626;
  --party-other: #7c3aed;
  --radius: 14px;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* ===== Header ===== */
.header {
  padding: max(env(safe-area-inset-top), 8px) max(env(safe-area-inset-right), 16px) 8px max(env(safe-area-inset-left), 16px);
  text-align: center;
  border-bottom: 1px solid #1e1e3a;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hot-color);
  margin-bottom: 0;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.nav {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: nowrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.nav-btn.active {
  background: var(--hot-color);
  border-color: var(--hot-color);
  color: white;
}

.total-votes-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #2d2d44;
  white-space: nowrap;
}

.help-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: inherit;
}

.help-btn:hover {
  background: var(--hot-color);
  color: white;
  border-color: var(--hot-color);
}

.total-votes-badge span {
  color: var(--hot-color);
  font-weight: 800;
}

/* Category bar */
.category-bar {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
}

.cat-btn {
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.cat-btn.active {
  background: #8854d0;
  border-color: #8854d0;
  color: white;
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.mode.scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  height: 100%;
  padding-bottom: 40px;
  scroll-behavior: smooth;
}

.mode.scrollable.active {
  display: block;
}

.mode {
  display: none;
  width: 100%;
  max-width: 420px;
  height: 100%;
}

.mode.active {
  display: block;
}

/* ===== Solo Card Stack ===== */
#solo-mode.active {
  display: flex !important;
  flex-direction: column;
  height: 100%;
}

.card-stack {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card-area {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  user-select: none;
  will-change: transform;
}

.card-front {
  position: relative;
  z-index: 2;
  touch-action: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card-front > .card-image {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
}

.card-front > .card-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transform: scale(0.96);
  opacity: 0.8;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card.reveal {
  transform: scale(1);
  opacity: 1;
}

.result-inner {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.result-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #2d2d44;
}

.result-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.result-verdict {
  font-size: 2rem;
  font-weight: 900;
  padding: 4px 24px;
  border-radius: 8px;
}

.result-verdict.hot {
  color: var(--hot-color);
  border: 3px solid var(--hot-color);
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.result-verdict.not {
  color: var(--not-color);
  border: 3px solid var(--not-color);
}

.result-verdict.super {
  color: #ffd700;
  border: 3px solid #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.result-score-big {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.result-score-big .score-int {
  font-size: 3.5rem;
}

.result-score-big .score-dec {
  font-size: 1.8rem;
  opacity: 0.7;
}

.result-bar-wrap {
  width: 100%;
}

.result-bar {
  height: 8px;
  background: var(--bar-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.result-bar-fill {
  height: 100%;
  background: var(--hot-color);
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s ease;
}

.result-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.result-details {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.result-detail {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-detail-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.result-detail-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.result-detail-change {
  font-size: 0.8rem;
  font-weight: 700;
}

.result-detail-change.up { color: var(--rank-up); }
.result-detail-change.down { color: var(--rank-down); }

.result-detail-divider {
  width: 1px;
  height: 32px;
  background: #2d2d44;
}

/* 공유 아이콘 - 카드 우측 하단 absolute */
.share-icon-btn {
  position: absolute;
  right: 10px;
  bottom: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  color: var(--text-primary);
  z-index: 4;
}

.share-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* 공유 버튼 */
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 20px;
  background: #2a2a2e;
  border: 1px solid #3a3a3e;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  pointer-events: auto;
}

.share-btn:hover {
  background: #34343a;
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn-crown {
  margin-top: 16px;
  width: 100%;
}

/* 공유 모달 */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
}

.share-modal.show {
  display: flex;
}

.share-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: min(360px, calc(100vw - 32px));
  width: 100%;
  text-align: center;
}

.share-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

/* 공유 미리보기 카드 */
.share-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1a1a1f 0%, #232328 100%);
  border: 1px solid #2d2d34;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.share-preview::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(229, 57, 53, 0.15), transparent 70%);
  pointer-events: none;
}

.share-preview-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--hot-color);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(229, 57, 53, 0.3);
}

.share-preview-info {
  flex: 1;
  min-width: 0;
}

.share-preview-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-preview-meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-preview-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.share-preview-score-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.share-preview-score-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hot-color);
}

.share-preview-watermark {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

/* VS 매치 공유 미리보기 */
.share-preview-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  background: linear-gradient(135deg, rgba(229,57,53,0.08), rgba(30,30,60,0.5));
  border: 1px solid rgba(229, 57, 53, 0.15);
  border-radius: 14px;
  padding: 18px 14px;
  margin-bottom: 16px;
}

.share-vs-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.share-vs-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(229, 57, 53, 0.4);
  box-shadow: 0 0 16px rgba(229, 57, 53, 0.25);
}

.share-vs-name {
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.share-vs-score {
  font-size: 1rem;
  font-weight: 800;
  color: var(--hot-color);
}

.share-vs-badge {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--hot-color);
  text-shadow: 0 0 10px rgba(229, 57, 53, 0.5);
  flex-shrink: 0;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #2d2d44;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.share-option:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.share-option-icon {
  font-size: 1.5rem;
}

.share-modal-close {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ===== 도파민 알림 ===== */
.dopamine-stack {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 380px;
  padding: 0 16px;
}

@media (min-width: 1024px) {
  .dopamine-stack {
    top: 90px;
    bottom: auto;
    flex-direction: column;
  }
}

.dopa-toast {
  background: rgba(20, 20, 24, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 57, 53, 0.4);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.3);
  animation: dopaIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), dopaOut 0.4s ease 2.6s forwards;
  white-space: nowrap;
}

.dopa-toast.up {
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 8px 24px rgba(74, 222, 128, 0.3);
}

.dopa-toast.legendary {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1a0a00;
  border-color: #ffd700;
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
  animation: dopaInBig 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), dopaOut 0.4s ease 3.1s forwards;
  font-size: 0.95rem;
  padding: 12px 22px;
}

.dopa-icon {
  font-size: 1.1rem;
}

.dopa-arrow-up {
  color: #4ade80;
  font-weight: 900;
}

.dopa-arrow-down {
  color: #ef4444;
  font-weight: 900;
}

@keyframes dopaIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dopaInBig {
  0% { opacity: 0; transform: translateY(-30px) scale(0.5); }
  60% { transform: translateY(0) scale(1.15); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dopaOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.9); }
}

/* Floating numbers (점수 변동 떠오름) */
.floating-numbers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.float-num {
  position: absolute;
  font-size: 2rem;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 20px currentColor;
  animation: floatUp 1.4s ease-out forwards;
  pointer-events: none;
  font-feature-settings: 'tnum';
}

.float-num.minus {
  color: #ef4444;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100px) scale(1);
  }
}

/* ===== 도움말 모달 ===== */
.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9996;
  padding: 20px;
  overflow-y: auto;
}

.help-modal.show {
  display: flex;
  animation: detailFadeIn 0.25s ease;
}

.help-modal-content {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 28px 24px;
  max-width: min(480px, calc(100vw - 32px));
  width: 100%;
  position: relative;
  margin: 20px 0 60px;
  border: 1px solid #2a2a2e;
}

.help-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
}

.help-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.help-section {
  margin-bottom: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.help-section-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.help-section h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.help-section ul {
  list-style: none;
  padding: 0;
}

.help-section ul li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
  line-height: 1.6;
}

.help-section ul li b {
  color: var(--text-primary);
  font-weight: 700;
}

.help-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

/* 등급 리스트 */
.grade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grade-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.grade-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.grade-info {
  flex: 1;
}

.grade-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.grade-cond {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.grade-limit {
  font-size: 0.7rem;
  color: var(--hot-color);
  font-weight: 700;
  margin-top: 2px;
}

.grade-item.legendary-grade {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 170, 0, 0.05));
  border-color: rgba(255, 215, 0, 0.3);
}
.grade-item.legendary-grade .grade-name { color: #ffd700; }

.grade-item.diamond-grade {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(0, 100, 200, 0.04));
  border-color: rgba(0, 212, 255, 0.25);
}
.grade-item.diamond-grade .grade-name { color: #00d4ff; }

.grade-item.platinum-grade {
  background: rgba(220, 220, 220, 0.05);
  border-color: rgba(220, 220, 220, 0.1);
}

.grade-item.gold-grade {
  background: rgba(255, 193, 7, 0.05);
  border-color: rgba(255, 193, 7, 0.1);
}

.grade-item.silver-grade {
  background: rgba(173, 181, 189, 0.04);
  border-color: rgba(173, 181, 189, 0.08);
}

/* ===== 인물 상세 모달 ===== */
.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  padding: 20px;
}

.detail-modal.show {
  display: flex;
  animation: detailFadeIn 0.25s ease;
}

@keyframes detailFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: min(380px, calc(100vw - 32px));
  width: 100%;
  position: relative;
  max-height: 85dvh;
  overflow-y: auto;
  animation: detailSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes detailSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.detail-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--hot-color);
}

.detail-info {
  flex: 1;
}

.detail-name {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-party {
  display: inline-block;
  margin-bottom: 4px;
}

.detail-position {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.detail-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hot-color);
  margin-bottom: 2px;
}

.detail-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.detail-chart-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}

.detail-chart {
  width: 100%;
  height: 160px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px;
}

.detail-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-line {
  fill: none;
  stroke: url(#chartGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartAreaGrad);
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

.chart-dot {
  fill: var(--hot-color);
}

.chart-axis-label {
  fill: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  font-family: inherit;
}

/* 랭킹 아이템 클릭 가능 */
.ranking-item {
  cursor: pointer;
}

.ranking-item:hover {
  background: rgba(255, 71, 87, 0.05);
}

.card.swiping {
  transition: none;
}

.card.swipe-right {
  animation: swipeRight 0.35s ease forwards;
}

.card.swipe-left {
  animation: swipeLeft 0.35s ease forwards;
}

.card-stack > .card-actions {
  flex-shrink: 0;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cardOut {
  from {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateX(-100px);
  }
}

@keyframes swipeRight {
  to {
    transform: translateX(120%) rotate(20deg);
    opacity: 0;
  }
}

@keyframes swipeLeft {
  to {
    transform: translateX(-120%) rotate(-20deg);
    opacity: 0;
  }
}

.card.exit {
  animation: cardOut 0.3s ease forwards;
}

/* Score tag on photo */
.score-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 14px;
  z-index: 15;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}

.score-int {
  font-size: 2.6rem;
}

.score-dec {
  font-size: 1.3rem;
  opacity: 0.7;
}

.score-tag.hot {
  border-color: rgba(255, 71, 87, 0.5);
  color: #ff6b6b;
}

.score-tag.warm {
  border-color: rgba(255, 165, 0, 0.4);
  color: #ffa500;
}

.score-tag.cold {
  border-color: rgba(87, 101, 116, 0.4);
  color: #8395a7;
}

/* 이미지 로더 (스피너) */
.img-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16213e;
  z-index: 13;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.img-loader.show {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--hot-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Photo credit (출처) */
.photo-credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 14;
  pointer-events: none;
  letter-spacing: 0.2px;
}

/* Photo label */
.photo-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 15;
  display: none;
}

.photo-label.show {
  display: block;
}

/* Swipe hint indicators — 틴더 스타일 */
.swipe-hint {
  position: absolute;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  border: 4px solid;
  transform: rotate(0deg);
  text-transform: uppercase;
}

.swipe-hint.hot-hint {
  top: 60px;
  left: 20px;
  color: var(--hot-color);
  border-color: var(--hot-color);
  transform: rotate(-15deg);
}

.swipe-hint.not-hint {
  top: 60px;
  right: 20px;
  color: var(--not-color);
  border-color: var(--not-color);
  transform: rotate(15deg);
}

.swipe-hint.super-hint {
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  color: #ffd700;
  border-color: #ffd700;
  font-size: 2.2rem;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.swipe-hint.down-hint {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--not-color);
  border-color: var(--not-color);
}

/* Particle canvas */
.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.card-image {
  position: relative;
  width: 100%;
  background: #16213e;
  overflow: hidden;
}

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

/* ===== Overlay (투표 결과) ===== */
.card-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.card-overlay.show {
  opacity: 1;
}

.overlay-result {
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overlay-result.hot {
  color: var(--hot-color);
}

.overlay-result.not {
  color: var(--not-color);
}

.overlay-stats {
  text-align: center;
  width: 80%;
}

.stat-bar {
  height: 8px;
  background: var(--bar-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.stat-fill {
  height: 100%;
  background: var(--hot-color);
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s ease;
}

.stat-text {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-rank {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-score {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.rank-change,
.score-change {
  font-weight: 700;
  margin-left: 4px;
}

.rank-change.up,
.score-change.up {
  color: var(--rank-up);
}

.rank-change.down,
.score-change.down {
  color: var(--rank-down);
}

/* ===== Badges (상장) ===== */
.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.name-row h2 {
  flex-shrink: 0;
}

.badge-area {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 1;
  overflow: hidden;
}

.badge-area:empty {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  animation: badgeIn 0.4s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.badge-icon {
  font-size: 0.8rem;
}

@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.badge::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  border-radius: 20px;
}

.badge-icon {
  font-size: 0.9rem;
}

/* SSS 등급 — 전설 */
.badge.legendary {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a0a00;
  border: 1px solid #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.2);
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

/* SS 등급 — 다이아몬드 */
.badge.diamond {
  background: linear-gradient(135deg, #b9f2ff, #00d4ff);
  color: #003344;
  border: 1px solid #00d4ff;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

/* S 등급 — 플래티넘 */
.badge.platinum {
  background: linear-gradient(135deg, #e8e8e8, #c0c0c0);
  color: #333;
  border: 1px solid #c0c0c0;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
}

/* A 등급 — 골드 */
.badge.gold {
  background: linear-gradient(135deg, #fff3cd, #ffc107);
  color: #664d00;
  border: 1px solid #ffc107;
}

/* B 등급 — 실버 */
.badge.silver {
  background: linear-gradient(135deg, #e9ecef, #adb5bd);
  color: #495057;
  border: 1px solid #adb5bd;
}

/* 특수 배지 */
.badge.controversial {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  border: 1px solid #ee5a24;
  box-shadow: 0 0 8px rgba(238, 90, 36, 0.4);
}

.badge.rising {
  background: linear-gradient(135deg, #2ed573, #17c964);
  color: #003300;
  border: 1px solid #17c964;
  box-shadow: 0 0 8px rgba(23, 201, 100, 0.4);
}

.badge.popular {
  background: linear-gradient(135deg, #a55eea, #8854d0);
  color: #fff;
  border: 1px solid #8854d0;
  box-shadow: 0 0 8px rgba(136, 84, 208, 0.4);
}

.badge.frozen {
  background: linear-gradient(135deg, #576574, #222f3e);
  color: #c8d6e5;
  border: 1px solid #576574;
}

/* 랭킹 아이템 배지 */
.ranking-badges {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.ranking-badges .badge {
  font-size: 0.6rem;
  padding: 2px 6px;
}

.ranking-badges .badge-icon {
  font-size: 0.7rem;
}

/* ===== Card Info ===== */
.card-info {
  padding: 6px 14px 4px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
}

.card-info h2 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.party-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.party-tag.democrat {
  background: rgba(0, 82, 204, 0.2);
  color: #4a9eff;
}

.party-tag.people {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
}

.party-tag.other {
  background: rgba(142, 68, 173, 0.2);
  color: #bb8fce;
}

.party-tag.idol {
  background: rgba(255, 107, 181, 0.2);
  color: #ff6bb5;
}

.position-tag {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ===== Buttons ===== */
.card-actions {
  display: flex;
  gap: 10px;
  padding: 8px 16px 14px;
  justify-content: center;
}

.btn-hot,
.btn-not {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-hot {
  background: var(--hot-color);
  color: white;
}

.btn-hot:active {
  transform: scale(0.95);
}

.btn-not {
  background: #2d2d44;
  color: var(--text-secondary);
}

.btn-not:active {
  transform: scale(0.95);
}

.btn-icon {
  font-size: 1.3rem;
}

.progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 4px;
  flex-shrink: 0;
}

/* ===== VS Mode ===== */
.vs-container {
  display: flex;
  gap: 4px;
  align-items: stretch;
  position: relative;
}

.vs-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.vs-card:active {
  transform: scale(0.97);
}

.vs-card .card-image {
  aspect-ratio: 2 / 3;
}

.vs-card .card-info {
  padding: 10px 8px;
}

.vs-card .card-info h2 {
  font-size: 1rem;
}

.vs-divider {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  color: var(--hot-color);
  font-weight: 900;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 50%;
  z-index: 10;
  border: 2px solid var(--hot-color);
}

.vs-percent {
  font-size: 2rem;
  font-weight: 900;
  color: white;
}

.vs-instruction {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 16px;
}

/* VS overlay */
.vs-card .card-overlay {
  gap: 8px;
}

.vs-card .overlay-result {
  font-size: 2rem;
}

/* ===== VS 충돌 / 승리 애니메이션 ===== */
.vs-card {
  will-change: transform;
}

.vs-left.collide-left {
  animation: collideLeft 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards;
}

.vs-right.collide-right {
  animation: collideRight 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards;
}

.vs-left.collide-loser {
  animation: collideLeft 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards, loserShatter 0.35s ease-out 0.18s forwards;
}

.vs-right.collide-loser {
  animation: collideRight 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards, loserShatter 0.35s ease-out 0.18s forwards;
}

.vs-left.collide-winner {
  animation: collideLeft 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards, winnerCenterLeft 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.18s forwards;
  z-index: 20;
}

.vs-right.collide-winner {
  animation: collideRight 0.18s cubic-bezier(0.5, 0, 0.9, 1) forwards, winnerCenterRight 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.18s forwards;
  z-index: 20;
}

/* 승자 이미지 플래시 */
.vs-card.collide-winner .card-image img {
  animation: winnerFlash 0.7s ease-out 0.18s;
}

@keyframes winnerFlash {
  0% { filter: brightness(1); }
  20% { filter: brightness(2.5) saturate(1.5); }
  40% { filter: brightness(1.8) saturate(1.3); }
  100% { filter: brightness(1.1) saturate(1.1); }
}

@keyframes winnerCenterLeft {
  0% {
    transform: translateX(40%) rotate(8deg) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  60% {
    transform: translateX(50%) rotate(0) scale(1.25);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.8), 0 0 120px rgba(255, 71, 87, 0.5);
  }
  100% {
    transform: translateX(50%) rotate(0) scale(1.2);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.7), 0 0 100px rgba(255, 71, 87, 0.4);
  }
}

@keyframes winnerCenterRight {
  0% {
    transform: translateX(-40%) rotate(-8deg) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  60% {
    transform: translateX(-50%) rotate(0) scale(1.25);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.8), 0 0 120px rgba(255, 71, 87, 0.5);
  }
  100% {
    transform: translateX(-50%) rotate(0) scale(1.2);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.7), 0 0 100px rgba(255, 71, 87, 0.4);
  }
}

@keyframes collideLeft {
  0% { transform: translateX(0) rotate(0); }
  100% { transform: translateX(40%) rotate(8deg); }
}

@keyframes collideRight {
  0% { transform: translateX(0) rotate(0); }
  100% { transform: translateX(-40%) rotate(-8deg); }
}

@keyframes loserShatter {
  0% { opacity: 1; filter: brightness(1); transform: scale(1) translateX(var(--lose-x, 0)); }
  50% { opacity: 0.5; filter: brightness(0.4) blur(2px); }
  100% { opacity: 0; filter: brightness(0.2) blur(8px); transform: scale(0.7) translateY(40px); }
}

@keyframes winnerGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.8), 0 0 120px rgba(255, 71, 87, 0.5);
  }
  100% {
    transform: scale(1.1) translateX(0);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
  }
}

/* WIN 텍스트 */
.vs-card .overlay-result.hot {
  animation: winText 0.5s ease 0.5s both;
}

@keyframes winText {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.3) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* VS 점수 비교 */
.vs-scores {
  margin-top: 18px;
  padding: 16px 12px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid #2a2a2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vs-score-side {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.vs-score-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--hot-color);
  letter-spacing: -1px;
  font-feature-settings: 'tnum';
}

.vs-score-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vs-score-divider {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 0 8px;
}

/* VS 예상 승률 게이지 (deprecated) */
.vs-gauge {
  display: none;
}

.vs-gauge-title {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.vs-gauge-bar {
  position: relative;
  height: 10px;
  background: #1a1a1e;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  border: 1px solid #2a2a2e;
}

.vs-gauge-left {
  height: 100%;
  background: linear-gradient(90deg, #e53935, #c92a2a);
  width: 50%;
  transition: width 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.vs-gauge-right {
  height: 100%;
  background: linear-gradient(90deg, #5a5a5e, #3a3a3e);
  width: 50%;
  transition: width 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.vs-gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.vs-gauge-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.vs-gauge-side.right {
  align-items: flex-end;
}

.vs-gauge-pct {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--hot-color);
}

.vs-gauge-side.right .vs-gauge-pct {
  color: var(--text-secondary);
}

.vs-gauge-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 우세 표시 (50% 초과 쪽 강조) */
.vs-gauge-side.leading .vs-gauge-pct {
  color: var(--hot-color);
}
.vs-gauge-side.losing .vs-gauge-pct {
  color: var(--text-secondary);
}

/* ===== Ranking ===== */
.ranking-header {
  margin-bottom: 16px;
}

.ranking-header h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.ranking-period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.rank-period-btn {
  flex: 1;
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.rank-period-btn.active {
  background: var(--hot-color);
  border-color: var(--hot-color);
  color: white;
}

.ranking-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-btn.active {
  background: var(--hot-color);
  border-color: var(--hot-color);
  color: white;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 12px;
  transition: var(--transition);
}

.ranking-item:first-child {
  border: 1px solid var(--hot-color);
}

.ranking-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-secondary);
  min-width: 30px;
  text-align: center;
}

.ranking-item:nth-child(1) .ranking-number { color: #ffd700; }
.ranking-item:nth-child(2) .ranking-number { color: #c0c0c0; }
.ranking-item:nth-child(3) .ranking-number { color: #cd7f32; }

.ranking-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.ranking-party {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ranking-stats {
  text-align: right;
}

.ranking-score {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--hot-color);
}

.ranking-hot-rate {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== TOP Mode (시상대) ===== */
#top-mode.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 10px 16px 30px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.top-period-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.top-period-label {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
  text-align: center;
}

/* 시상대 컨테이너 */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 540px;
  margin: 30px auto 0;
  padding: 0 10px;
  min-height: 320px;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.podium-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  animation: figureIn 0.6s ease-out;
  z-index: 3;
  position: relative;
}

@keyframes figureIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.podium-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid;
  margin-bottom: 4px;
}

.podium-1 .podium-photo {
  width: 140px;
  height: 140px;
  border-width: 6px;
}

.podium-photo.gold { border-color: #ffd700; box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); }
.podium-photo.silver { border-color: #d9d9d9; box-shadow: 0 0 28px rgba(192, 192, 192, 0.4); }
.podium-photo.bronze { border-color: #cd7f32; box-shadow: 0 0 28px rgba(205, 127, 50, 0.4); }

.podium-medal {
  font-size: 2rem;
  margin-top: -18px;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.podium-1 .podium-medal { font-size: 2.4rem; }

.podium-name {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-1 .podium-name { font-size: 1.2rem; }

.podium-score {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 4px;
}

.podium-1 .podium-score { color: #ffd700; font-size: 1.25rem; }
.podium-2 .podium-score { color: #d9d9d9; }
.podium-3 .podium-score { color: #cd7f32; }

.podium-crown {
  position: absolute;
  top: -40px;
  font-size: 3rem;
  animation: crownBob 2s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(255, 215, 0, 0.6));
  z-index: 5;
}

@keyframes crownBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 시상대 블럭 — 평면이지만 입체감 있게 */
.podium-block {
  width: 100%;
  position: relative;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: blockRiseUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes blockRiseUp {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

.podium-1 .podium-block { height: 160px; }
.podium-2 .podium-block { height: 110px; }
.podium-3 .podium-block { height: 70px; }

.podium-rank {
  font-size: 5rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.25);
  font-family: 'Inter', sans-serif;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.podium-1 .podium-rank { font-size: 7rem; }
.podium-3 .podium-rank { font-size: 3rem; }

/* 블록 쓸데없는 면 숨김 */
.podium-block-top,
.podium-block-side {
  display: none;
}

/* 금 */
.podium-block-gold {
  background: linear-gradient(180deg, #ffea7a 0%, #ffd700 30%, #d4a808 100%);
  box-shadow:
    inset 0 -20px 30px rgba(0, 0, 0, 0.25),
    inset 0 4px 0 rgba(255, 255, 255, 0.5),
    inset 6px 0 12px rgba(255, 255, 255, 0.2),
    inset -6px 0 12px rgba(0, 0, 0, 0.15),
    0 12px 30px rgba(255, 215, 0, 0.4),
    0 4px 0 #8b6914;
}

/* 은 */
.podium-block-silver {
  background: linear-gradient(180deg, #f5f5f5 0%, #c8c8c8 30%, #888 100%);
  box-shadow:
    inset 0 -20px 30px rgba(0, 0, 0, 0.25),
    inset 0 4px 0 rgba(255, 255, 255, 0.6),
    inset 6px 0 12px rgba(255, 255, 255, 0.2),
    inset -6px 0 12px rgba(0, 0, 0, 0.15),
    0 12px 30px rgba(192, 192, 192, 0.3),
    0 4px 0 #555;
}

/* 동 */
.podium-block-bronze {
  background: linear-gradient(180deg, #f4b878 0%, #cd7f32 30%, #6b3410 100%);
  box-shadow:
    inset 0 -20px 30px rgba(0, 0, 0, 0.3),
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    inset 6px 0 12px rgba(255, 255, 255, 0.15),
    inset -6px 0 12px rgba(0, 0, 0, 0.2),
    0 12px 30px rgba(205, 127, 50, 0.3),
    0 4px 0 #3d1d08;
}

/* 그림자 (바닥) */
.podium-spot::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  filter: blur(4px);
}

/* 금 */
.podium-block-gold .podium-block-front {
  background: linear-gradient(180deg, #fff4a3 0%, #ffd700 30%, #ffaa00 70%, #b8860b 100%);
  box-shadow:
    inset 0 -16px 32px rgba(0,0,0,0.25),
    inset 0 4px 8px rgba(255, 255, 255, 0.4),
    0 16px 40px rgba(255, 215, 0, 0.5);
}
.podium-block-gold .podium-block-top {
  background: radial-gradient(ellipse at center, #fff4a3 0%, #ffd700 60%, #d4a808 100%);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
}
.podium-block-gold .podium-block-side {
  background: linear-gradient(90deg, #ffaa00, #8b6914);
}

/* 은 */
.podium-block-silver .podium-block-front {
  background: linear-gradient(180deg, #fafafa 0%, #d9d9d9 30%, #b0b0b0 70%, #707070 100%);
  box-shadow:
    inset 0 -16px 32px rgba(0,0,0,0.25),
    inset 0 4px 8px rgba(255, 255, 255, 0.5),
    0 12px 32px rgba(192, 192, 192, 0.4);
}
.podium-block-silver .podium-block-top {
  background: radial-gradient(ellipse at center, #ffffff 0%, #d9d9d9 60%, #999 100%);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.6);
}
.podium-block-silver .podium-block-side {
  background: linear-gradient(90deg, #b0b0b0, #444);
}

/* 동 */
.podium-block-bronze .podium-block-front {
  background: linear-gradient(180deg, #f4b878 0%, #cd7f32 30%, #a0521e 70%, #6b3410 100%);
  box-shadow:
    inset 0 -16px 32px rgba(0,0,0,0.3),
    inset 0 4px 8px rgba(255, 255, 255, 0.3),
    0 12px 32px rgba(205, 127, 50, 0.4);
}
.podium-block-bronze .podium-block-top {
  background: radial-gradient(ellipse at center, #f4b878 0%, #cd7f32 60%, #8b4513 100%);
  box-shadow: inset 0 0 20px rgba(255, 200, 150, 0.4);
}
.podium-block-bronze .podium-block-side {
  background: linear-gradient(90deg, #a0521e, #3d1d08);
}

.period-btn {
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 11px 22px;
  min-height: 44px;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.period-btn.active {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  border-color: #ffd700;
  color: #000;
}

.top-crown-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1);
  animation: crownPulse 3s ease-in-out infinite;
}

@keyframes crownPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1); }
  50% { box-shadow: 0 8px 48px rgba(255, 215, 0, 0.25); }
}

.crown-badge {
  font-size: 3rem;
  margin-bottom: 4px;
}

.crown-period {
  font-size: 0.85rem;
  color: #ffd700;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.crown-label {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.crown-image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 3px solid #ffd700;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.3);
}

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

.crown-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.crown-party {
  margin-bottom: 20px;
}

.crown-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.crown-stat {
  text-align: center;
}

.crown-stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffd700;
}

.crown-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.crown-stat-divider {
  width: 1px;
  height: 32px;
  background: #2d2d44;
}

.crown-bar-container {
  width: 100%;
}

.crown-bar {
  height: 10px;
  background: var(--not-color);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.crown-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hot-color), var(--accent));
  border-radius: 5px;
  transition: width 0.8s ease;
}

.crown-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Runner ups */
.top-runner-ups {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.runner-up {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  position: relative;
}

.runner-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.runner-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid #2d2d44;
}

.runner-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.runner-score {
  color: var(--hot-color);
  font-weight: 800;
  font-size: 1rem;
}

/* ===== Stats Mode ===== */
.stats-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.stats-period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.stats-period-btn {
  flex: 1;
  background: transparent;
  border: 1px solid #2d2d44;
  color: var(--text-secondary);
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.stats-period-btn.active {
  background: var(--hot-color);
  border-color: var(--hot-color);
  color: white;
}

.stats-date-range {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

.stats-date-picker {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.stats-date-picker.show {
  display: flex;
}

.date-input {
  background: var(--bg-card);
  border: 1px solid #2d2d44;
  color: var(--text-primary);
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color-scheme: dark;
}

.date-input:focus {
  outline: 2px solid var(--hot-color);
  outline-offset: 2px;
}

.date-apply-btn {
  background: var(--hot-color);
  border: none;
  color: white;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.date-apply-btn:hover {
  filter: brightness(1.1);
}

.stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--hot-color);
  margin-bottom: 4px;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stats-section {
  margin-bottom: 24px;
}

.stats-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* 정당별 통계 */
.party-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.party-stat-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 16px;
}

.party-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.party-stat-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.party-stat-rate {
  font-weight: 800;
  color: var(--hot-color);
}

.party-stat-bar {
  height: 6px;
  background: var(--bar-bg);
  border-radius: 3px;
  overflow: hidden;
}

.party-stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.party-stat-bar-fill.democrat {
  background: linear-gradient(90deg, #0052cc, #4a9eff);
}

.party-stat-bar-fill.people {
  background: linear-gradient(90deg, #e74c3c, #ff6b6b);
}

.party-stat-bar-fill.other {
  background: linear-gradient(90deg, #8e44ad, #bb8fce);
}

.party-stat-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 논란 리스트 */
.controversial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controversial-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 12px;
}

.controversial-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.controversial-info {
  flex: 1;
}

.controversial-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.controversial-rate {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.controversial-badge {
  background: rgba(255, 165, 0, 0.15);
  color: #ffa500;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}

/* 극단 카드 */
.extreme-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: 12px;
}

.extreme-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.extreme-info {
  flex: 1;
}

.extreme-name {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.extreme-party {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.extreme-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--hot-color);
}

.extreme-value.not-style {
  color: var(--not-color);
}

/* 투표 많은 순 */
.most-voted-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.most-voted-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 12px;
}

.most-voted-rank {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: center;
}

.most-voted-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.most-voted-info {
  flex: 1;
}

.most-voted-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.most-voted-party {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.most-voted-count {
  font-weight: 800;
  color: var(--accent);
}

/* ===== Ad Slots ===== */
.ad-slot {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  min-height: 60px;
  background: #12121f;
  border: 1px dashed #2d2d44;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  color: #3a3a5c;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 솔로 모드 광고는 더 작게 (앱처럼) */
.ad-card-bottom {
  margin-top: 6px;
  min-height: 50px;
}
.ad-card-bottom .ad-placeholder {
  min-height: 50px;
}

/* 실제 AdSense 삽입 시 placeholder 숨기기 */
.ad-slot ins + .ad-placeholder {
  display: none;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 8px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  border-top: 1px solid #1e1e3a;
  flex-shrink: 0;
}

/* ===== Desktop only (모바일에서 숨김) ===== */
.desktop-sidebar,
.desktop-actions {
  display: none;
}

.desktop-actions {
  gap: 12px;
  padding: 16px 0 0;
  justify-content: center;
  flex-shrink: 0;
}

.desktop-btn {
  flex: 1;
  max-width: 140px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
}

.pc-btn-icon {
  font-size: 1.5rem;
}

.pc-btn-label {
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.btn-hot-pc {
  background: var(--hot-color);
  color: white;
}

.btn-not-pc {
  background: #2d2d44;
  color: var(--text-secondary);
}

.btn-super-pc {
  background: #f5b800;
  color: #1a0a00;
}

.desktop-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.desktop-btn:active {
  transform: translateY(0);
}

.sidebar-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sidebar-title-row .sidebar-title {
  margin-bottom: 0;
}

/* 모바일은 헤더에, PC는 사이드바에 표시 */
@media (max-width: 1023px) {
  .sidebar-title-row .help-btn {
    display: none;
  }
}
@media (min-width: 1024px) {
  .help-btn-mobile {
    display: none;
  }
}

.live-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.live-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  animation: liveSlideIn 0.3s ease;
}

@keyframes liveSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.live-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.live-info {
  flex: 1;
  min-width: 0;
}

.live-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-vote {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.live-vote.hot { color: var(--hot-color); }
.live-vote.not { color: var(--not-color); }
.live-vote.super { color: #ffd700; }

.live-score {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--hot-color);
  flex-shrink: 0;
}

.keyboard-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.key-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #2d2d44;
  border: 1px solid #3d3d5c;
  border-radius: 6px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.mini-ranking {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.mini-rank-item:hover {
  background: rgba(255, 71, 87, 0.1);
}

.mini-rank-num {
  font-weight: 800;
  color: var(--text-secondary);
  min-width: 22px;
  text-align: center;
}

.mini-rank-item:nth-child(1) .mini-rank-num { color: #ffd700; }
.mini-rank-item:nth-child(2) .mini-rank-num { color: #c0c0c0; }
.mini-rank-item:nth-child(3) .mini-rank-num { color: #cd7f32; }

.mini-rank-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.mini-rank-info {
  flex: 1;
  min-width: 0;
}

.mini-rank-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-rank-party {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.mini-rank-score {
  font-weight: 800;
  color: var(--hot-color);
  font-size: 0.95rem;
}

.rank-up {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--rank-up);
  margin-left: 4px;
}

.rank-down {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--rank-down);
  margin-left: 4px;
}

.rank-new {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1a0a00;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.mini-rank-item.rank-changed-up {
  animation: rankFlashUp 0.8s ease-out;
}

.mini-rank-item.rank-changed-down {
  animation: rankFlashDown 0.8s ease-out;
}

@keyframes rankFlashUp {
  0% {
    background: rgba(46, 213, 115, 0.4);
    transform: translateX(-8px);
  }
  100% {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(0);
  }
}

@keyframes rankFlashDown {
  0% {
    background: rgba(255, 71, 87, 0.3);
    transform: translateX(8px);
  }
  100% {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(0);
  }
}

/* ===== PC 레이아웃 ===== */
@media (min-width: 1024px) {
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  .header {
    padding: 16px 24px;
  }

  .logo {
    font-size: 1.4rem;
  }

  .nav-btn {
    padding: 8px 18px;
    font-size: 0.95rem;
  }

  .main {
    display: grid;
    grid-template-columns: 280px minmax(420px, 460px) 280px;
    gap: 24px;
    padding: 24px;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    overflow: visible;
    min-height: 0;
    height: auto;
  }

  .desktop-sidebar {
    display: block;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  /* TOP 모드에서 사이드바 숨기고 가운데 정렬 */
  body.mode-top .main {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
  body.mode-top .desktop-sidebar {
    display: none;
  }

  .desktop-actions {
    display: flex;
  }

  /* PC에선 모드 안의 광고 영역 숨김 */
  .ad-card-bottom,
  .ad-vs-bottom {
    display: none;
  }

  .ad-sidebar {
    min-height: 250px;
    background: #12121f;
    border: 1px dashed #2d2d44;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mode {
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }

  /* PC에서 스크롤 모드는 자체 스크롤 끄고 페이지 전체 스크롤 사용 */
  .mode.scrollable {
    overflow: visible !important;
    height: auto !important;
    padding-bottom: 20px;
  }

  #solo-mode.active {
    display: flex !important;
    flex-direction: column;
    height: auto !important;
  }

  .card-stack {
    flex: none;
  }

  .card-front {
    flex: none;
    height: auto;
    width: 100%;
  }

  .card-front > .card-image {
    flex: none;
    width: 100%;
    height: 480px;
    aspect-ratio: auto;
  }

  .card-front > .card-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .card-image {
    aspect-ratio: 4 / 5;
  }

  .card-area {
    flex: none;
  }
}


/* ===== Responsive ===== */
@media (min-width: 768px) {
  .main {
    padding: 40px 20px;
  }

  .mode {
    max-width: 480px;
  }

  .btn-hot:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
  }

  .btn-not:hover {
    transform: scale(1.02);
  }

  .vs-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}

/* ===== 작은 화면 (iPhone SE 등 320~375px) ===== */
@media (max-width: 380px) {
  .nav {
    gap: 3px;
  }
  .nav-btn {
    padding: 7px 10px;
    font-size: 0.78rem;
  }
  .logo {
    font-size: 1rem;
  }
  .header {
    gap: 6px;
    padding: 6px 10px;
  }
  .total-votes-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .card-info h2 {
    font-size: 1.15rem;
  }

  .podium {
    gap: 4px;
    max-width: 100%;
  }
  .podium-photo {
    width: 84px;
    height: 84px;
    border-width: 4px;
  }
  .podium-1 .podium-photo {
    width: 100px;
    height: 100px;
    border-width: 5px;
  }
  .podium-name {
    font-size: 0.85rem;
    max-width: 100px;
  }
  .podium-rank {
    font-size: 4rem;
  }
  .podium-1 .podium-rank {
    font-size: 5.5rem;
  }
  .podium-3 .podium-rank {
    font-size: 2.5rem;
  }

  .stats-summary {
    gap: 6px;
  }
  .summary-card {
    padding: 12px 8px;
  }
  .summary-value {
    font-size: 1.2rem;
  }

  .ranking-item {
    padding: 10px 12px;
    gap: 8px;
  }
  .ranking-photo {
    width: 40px;
    height: 40px;
  }
}

/* ===== 랜드스케이프 (낮은 높이) ===== */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    overflow: auto;
    height: auto;
  }
  .header {
    position: relative;
  }
  #solo-mode.active {
    height: auto !important;
    min-height: calc(100vh - 60px);
  }
  .card-front > .card-image {
    max-height: 65vh;
  }
  .card-info h2 {
    font-size: 1.1rem;
  }
}

/* ===== 모달 열림 시 배경 스크롤 방지 ===== */
body.modal-open {
  overflow: hidden;
}
