/* =============================================================================
   FUTURISTIC JUMP ROPE GAME - COMPLETE UI REDESIGN
   네온 글로우 효과와 파티클 애니메이션을 활용한 최신 게임 디자인
============================================================================= */

/* CSS 변수 정의 - 테마 색상 */
:root {
  --primary-neon: #00f3ff;
  --secondary-neon: #ff006e;
  --accent-neon: #8338ec;
  --warning-neon: #ffbe0b;
  --success-neon: #3a86ff;
  --bg-dark: #0a0a0f;
  --bg-dark-secondary: #1a1a2e;
  --text-light: #ffffff;
  --text-glow: #00f3ff;
  --border-glow: rgba(0, 243, 255, 0.5);
  --shadow-neon: 0 0 20px var(--primary-neon);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 기본 리셋 및 글로벌 스타일 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: 'Orbitron', 'Exo 2', monospace;
  background: var(--bg-dark);
  color: var(--text-light);
  position: relative;
}

/* 동적 배경 시스템 */
#dynamic-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(131, 56, 236, 0.1) 0%,
    rgba(255, 0, 110, 0.05) 35%,
    rgba(0, 243, 255, 0.03) 70%,
    var(--bg-dark) 100%
  );
  animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.1) rotate(5deg); opacity: 1; }
}

.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-particles::before,
.floating-particles::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary-neon);
  border-radius: 50%;
  box-shadow: 
    0 0 6px var(--primary-neon),
    0 0 12px var(--primary-neon),
    0 0 18px var(--primary-neon);
  animation: floatParticles 15s linear infinite;
}

.floating-particles::before {
  top: 10%;
  left: 20%;
  animation-delay: -5s;
}

.floating-particles::after {
  top: 60%;
  left: 80%;
  animation-delay: -10s;
}

@keyframes floatParticles {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

.grid-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.1; }
}

/* 미래적 프리로더 */
.futuristic-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease-out;
}

.loading-container {
  text-align: center;
  position: relative;
}

.loading-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.ring {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: spinRing 2s linear infinite;
}

.ring:nth-child(1) {
  width: 120px;
  height: 120px;
  border-top: 2px solid var(--primary-neon);
  border-right: 2px solid var(--primary-neon);
  animation-duration: 2s;
}

.ring:nth-child(2) {
  width: 100px;
  height: 100px;
  top: 10px;
  left: 10px;
  border-bottom: 2px solid var(--secondary-neon);
  border-left: 2px solid var(--secondary-neon);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.ring:nth-child(3) {
  width: 80px;
  height: 80px;
  top: 20px;
  left: 20px;
  border-top: 2px solid var(--accent-neon);
  border-right: 2px solid var(--accent-neon);
  animation-duration: 1s;
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-glow);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.glitch-text {
  position: relative;
  display: inline-block;
  animation: glitch 1.5s infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    text-shadow: 
      0.05em 0 0 var(--secondary-neon),
      -0.05em -0.025em 0 var(--primary-neon),
      0.025em 0.05em 0 var(--accent-neon);
  }
  15% {
    text-shadow: 
      0.05em 0 0 var(--secondary-neon),
      -0.05em -0.025em 0 var(--primary-neon),
      0.025em 0.05em 0 var(--accent-neon);
  }
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(0, 243, 255, 0.2);
  border-radius: 2px;
  margin: 1rem auto;
  overflow: hidden;
}

.progress-bar {
    height: 100%;
  background: linear-gradient(90deg, var(--primary-neon), var(--secondary-neon));
  border-radius: 2px;
  animation: progressLoad 3s ease-in-out infinite;
  box-shadow: 0 0 10px var(--primary-neon);
}

@keyframes progressLoad {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.circuit-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(0, 243, 255, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 110, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 40% 60%, rgba(131, 56, 236, 0.1) 2px, transparent 2px);
  background-size: 100px 100px, 150px 150px, 120px 120px;
  animation: circuitPulse 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes circuitPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* 게임 설정 화면 스타일링 */
.game-setup-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
    height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 15, 0.95) 0%,
    rgba(26, 26, 46, 0.95) 50%,
    rgba(10, 10, 15, 0.95) 100%
  );
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: var(--transition-smooth);
}

.setup-container {
  width: 90%;
  max-width: 600px;
  position: relative;
}

.challenge-panel {
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.1) 0%,
    rgba(255, 0, 110, 0.05) 50%,
    rgba(131, 56, 236, 0.1) 100%
  );
  border: 2px solid var(--border-glow);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(15px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 60px rgba(0, 243, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.challenge-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--primary-neon) 50%,
    transparent 100%
  );
  animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
  0%, 100% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; transform: translateX(100%); }
}

/* 게임 헤더 */
.game-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.game-title {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  margin: 0;
  position: relative;
  display: inline-block;
}

.title-main {
  display: block;
  font-size: 2.5rem;
  color: var(--primary-neon);
  text-shadow: 
    0 0 10px var(--primary-neon),
    0 0 20px var(--primary-neon),
    0 0 40px var(--primary-neon);
  animation: titlePulse 2s ease-in-out infinite;
}

.title-sub {
  display: block;
  font-size: 1.2rem;
  color: var(--secondary-neon);
  text-shadow: 
    0 0 5px var(--secondary-neon),
    0 0 10px var(--secondary-neon);
  margin-top: 0.5rem;
  letter-spacing: 4px;
}

@keyframes titlePulse {
  0%, 100% { 
    transform: scale(1);
    text-shadow: 
      0 0 10px var(--primary-neon),
      0 0 20px var(--primary-neon),
      0 0 40px var(--primary-neon);
  }
  50% { 
    transform: scale(1.05);
    text-shadow: 
      0 0 15px var(--primary-neon),
      0 0 30px var(--primary-neon),
      0 0 60px var(--primary-neon);
  }
}

.title-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(0, 243, 255, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  animation: glowRotate 8s linear infinite;
  pointer-events: none;
}

@keyframes glowRotate {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 설정 섹션 스타일 */
.config-section {
  margin-bottom: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-glow);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* 화면 모드 선택기 */
.screen-mode-selector {
  display: flex;
  gap: 1rem;
}

.mode-btn {
  flex: 1;
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.1) 0%,
    rgba(131, 56, 236, 0.1) 100%
  );
  border: 2px solid rgba(0, 243, 255, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-light);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mode-btn:hover {
  border-color: var(--primary-neon);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
  transform: translateY(-2px);
}

.mode-btn.active {
  border-color: var(--primary-neon);
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(131, 56, 236, 0.2) 100%
  );
  box-shadow: 
    0 0 20px rgba(0, 243, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-icon {
  width: 24px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
  position: relative;
}

.portrait-icon {
  width: 16px;
  height: 24px;
}

.landscape-icon {
  width: 24px;
  height: 16px;
}

.selection-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-neon);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.mode-btn.active .selection-indicator {
  transform: scaleX(1);
}

/* 미래적 드롭다운 */
.futuristic-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-toggle {
  width: 100%;
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.1) 0%,
    rgba(131, 56, 236, 0.1) 100%
  );
  border: 2px solid rgba(0, 243, 255, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-light);
  font-family: 'Exo 2', sans-serif;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.dropdown-toggle:hover {
  border-color: var(--primary-neon);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.dropdown-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 243, 255, 0.1) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
}

.dropdown-toggle:hover::before {
  left: 100%;
}

.dropdown-text {
  flex: 1;
  text-align: left;
}

.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--primary-neon);
  transition: transform 0.3s ease;
}

.dropdown-toggle.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-dark-secondary);
  border: 2px solid var(--primary-neon);
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.dropdown-item {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.dropdown-item:hover {
  background: linear-gradient(
    90deg,
    rgba(0, 243, 255, 0.1) 0%,
    rgba(131, 56, 236, 0.1) 100%
  );
  color: var(--primary-neon);
}

.dropdown-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

/* 게임 모드 섹션 */
.game-mode-section {
  margin-top: 2rem;
}

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.selected-mode-display {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-glow);
  text-align: center;
  margin: 1rem 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--primary-neon);
}

/* 준비 버튼 */
.ready-button {
  width: 100%;
  background: linear-gradient(
    145deg,
    var(--primary-neon) 0%,
    var(--secondary-neon) 100%
  );
  border: none;
  border-radius: 15px;
  padding: 1.5rem;
  color: var(--bg-dark);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  box-shadow: 
    0 8px 32px rgba(0, 243, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ready-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 12px 48px rgba(0, 243, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ready-button:active {
  transform: translateY(-1px) scale(0.98);
}

.button-text {
  position: relative;
  z-index: 2;
}

.button-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.ready-button:hover .button-glow {
  transform: translateX(100%);
}

.button-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.button-particles::before,
.button-particles::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: buttonSparkle 2s ease-in-out infinite;
}

.button-particles::before {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.button-particles::after {
  bottom: 20%;
  right: 20%;
  animation-delay: 1s;
}

@keyframes buttonSparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}

/* 브랜드 섹션 */
.brand-section {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 243, 255, 0.2);
}

.brand-logo {
  height: 40px;
  opacity: 0.8;
  transition: var(--transition-smooth);
  filter: brightness(1.2) contrast(1.1);
}

.brand-logo:hover {
  opacity: 1;
  transform: scale(1.05);
}



/* 숨김 클래스 */
.hidden {
  display: none !important;
}

/* 스크롤바 스타일링 */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--primary-neon);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--primary-neon);
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-neon);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .setup-container {
    width: 95%;
    padding: 0 1rem;
  }
  
  .challenge-panel {
    padding: 1.5rem;
  }
  
  .title-main {
  font-size: 2rem;
  }
  
  .title-sub {
    font-size: 1rem;
  }
  
  .screen-mode-selector {
    flex-direction: column;
  }
  
  .mode-selector {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .challenge-panel {
    padding: 1rem;
  }
  
  .title-main {
    font-size: 1.5rem;
  }
  
  .title-sub {
    font-size: 0.9rem;
    letter-spacing: 2px;
  }
  
  .ready-button {
    padding: 1.25rem;
    font-size: 1rem;
  }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  :root {
    --primary-neon: #00ffff;
    --secondary-neon: #ff0080;
    --accent-neon: #9040ff;
    --border-glow: rgba(0, 255, 255, 0.8);
  }
  
  .challenge-panel {
    border-width: 3px;
  }
  
  .dropdown-toggle,
  .mode-btn {
    border-width: 3px;
  }
}

/* =============================================================================
   메인 게임 아레나 스타일링
============================================================================= */

.game-arena {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  z-index: 1;
}

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(26, 26, 46, 0.6) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 0 60px rgba(0, 243, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: var(--transition-smooth);
}

/* 파일명 입력 모달 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(
    145deg,
    var(--bg-dark-secondary) 0%,
    var(--bg-dark) 100%
  );
  border: 2px solid var(--primary-neon);
  border-radius: 20px;
  padding: 2rem;
  min-width: 400px;
  text-align: center;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(0, 243, 255, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-content h3 {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: var(--text-glow);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px var(--primary-neon);
}

.input-container {
  position: relative;
  margin-bottom: 2rem;
}

.input-container input {
  width: 100%;
  background: rgba(0, 243, 255, 0.1);
  border: 2px solid rgba(0, 243, 255, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-light);
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-container input:focus {
  border-color: var(--primary-neon);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.input-container input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-neon);
  transition: width 0.3s ease;
}

.input-container input:focus + .input-underline {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: var(--text-light);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  border-color: var(--text-light);
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: linear-gradient(
    145deg,
    var(--primary-neon) 0%,
    var(--secondary-neon) 100%
  );
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: var(--bg-dark);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 16px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 243, 255, 0.5);
}

/* 설정 버튼 */
.settings-trigger {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(131, 56, 236, 0.2) 100%
  );
  border: 2px solid var(--primary-neon);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 100;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-sizing: border-box;  /* 패딩과 테두리를 포함한 정확한 크기 계산 */
}

.settings-trigger:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.5);
}

.gear-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gear-icon::before {
  content: '⚙';
  font-size: 24px;
  color: var(--primary-neon);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  animation: gearRotate 4s linear infinite;
}

@keyframes gearRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.button-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(0, 243, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

.settings-trigger:active .button-ripple {
  width: 120px;
  height: 120px;
}

/* 설정 패널 */
.settings-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: linear-gradient(
    145deg,
    rgba(10, 10, 15, 0.95) 0%,
    rgba(26, 26, 46, 0.95) 100%
  );
  backdrop-filter: blur(15px);
  border-left: 2px solid var(--primary-neon);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow-y: auto;
}

.settings-panel.show {
  right: 0;
}

.panel-header {
  padding: 2rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: var(--text-glow);
  margin: 0;
  text-shadow: 0 0 10px var(--primary-neon);
}

.close-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid var(--secondary-neon);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-btn:hover {
  background: var(--secondary-neon);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.5);
}

.close-btn span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--secondary-neon);
  transition: background 0.3s ease;
}

.close-btn:hover span {
  background: var(--bg-dark);
}

.close-btn span:first-child {
  transform: rotate(45deg);
}

.close-btn span:last-child {
  transform: rotate(-45deg);
}

.panel-content {
  padding: 2rem;
}

.setting-group {
  margin-bottom: 2rem;
}

.setting-group label {
  display: block;
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  color: var(--text-glow);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.screen-mode-toggle {
  display: flex;
  gap: 1rem;
}

.mode-toggle-btn {
  flex: 1;
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.1) 0%,
    rgba(131, 56, 236, 0.1) 100%
  );
  border: 2px solid rgba(0, 243, 255, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-light);
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mode-toggle-btn:hover {
  border-color: var(--primary-neon);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.mode-toggle-btn.active {
  border-color: var(--primary-neon);
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(131, 56, 236, 0.2) 100%
  );
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.new-game-btn {
  width: 100%;
  background: linear-gradient(
    145deg,
    var(--warning-neon) 0%,
    var(--secondary-neon) 100%
  );
  border: none;
  border-radius: 12px;
  padding: 1rem;
  color: var(--bg-dark);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 16px rgba(255, 190, 11, 0.3);
}

.new-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 190, 11, 0.5);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.new-game-btn:hover .btn-glow {
  left: 100%;
}

.panel-footer {
  padding: 2rem;
  border-top: 1px solid rgba(0, 243, 255, 0.2);
  text-align: center;
}

.footer-logo {
  height: 32px;
  opacity: 0.7;
  filter: brightness(1.2);
}

/* 게임 UI 요소들 */
.dim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dim-overlay.show {
  opacity: 1;
  visibility: visible;
}

.event-indicator {
  position: absolute;
  top: 4rem;  /* 가로화면에서도 더 하단으로 이동 */
  left: 50%;
  transform: translateX(-50%);
  width: calc(85vh * 16/9 - 4rem);  /* 가로모드에서 웹캠 너비에 맞춤 (좌우 여백 2rem씩) */
  background: linear-gradient(
    145deg,
    rgba(255, 187, 0, 0.3) 0%,
    rgba(131, 56, 236, 0.5) 100%
  );
  border-radius: 15px;
  padding: 2.25rem 2rem;  /* 패딩 조정 */
  color: var(--text-glow);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  font-size: 3rem;  /* 3배 크기로 설정 */
  text-transform: uppercase;
  letter-spacing: 3px;  /* 3배 크기로 증가 */
  z-index: 50;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 30px rgba(0, 243, 255, 0.3),  /* 타이머와 동일한 그림자 */
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  max-width: calc(100vw - 8rem);  /* 화면 너비에서 좌우 여백 제외한 최대 너비 */
  min-width: 400px;  /* 최소 너비 보장 */
}

/* 가로화면에서 종목명이 화면 너비를 꽉 채우도록 설정 */
body.landscape-mode .event-indicator {
  top: 2rem;
  left: 2rem;
  right: 2rem;
  width: calc(100vw - 4rem);  /* 화면 너비에서 좌우 여백 2rem씩 제외 */
  max-width: none;  /* 최대 너비 제한 해제 */
  min-width: unset;  /* 최소 너비 제한 해제 */
  transform: none;
  text-align: center;
  padding: 1.5rem 2rem;  /* 가로모드용 패딩 조정 */
}

/* 세로화면에서 종목명 중앙 배치 */
body:not(.landscape-mode) .event-indicator {
  top: calc((100vh - 95vh) / 2 + 2rem);  /* 웹캠 상단 여백 + 2rem */
  left: calc((100vw - 98vw) / 2);  /* 웹캠 좌우 여백에 맞춤 */
  right: calc((100vw - 98vw) / 2);  /* 웹캠 좌우 여백에 맞춤 */
  width: 98vw;  /* 세로모드에서 웹캠 너비와 일치 */
  max-width: none;  /* 최대 너비 제한 해제 */
  min-width: unset;  /* 최소 너비 제한 해제 */
  transform: none;
  text-align: center;
  padding: 1.5rem 1rem;  /* 세로모드용 패딩 조정 */
}

/* 준비 오버레이 - 화려한 게임 스타일 */
.ready-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at center, rgba(0, 243, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(131, 56, 236, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(255, 0, 110, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.ready-overlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    conic-gradient(from 0deg at 50% 50%, 
      transparent 0deg, 
      rgba(0, 243, 255, 0.1) 90deg, 
      transparent 180deg, 
      rgba(131, 56, 236, 0.1) 270deg, 
      transparent 360deg);
  animation: readyBackgroundRotate 8s linear infinite;
  pointer-events: none;
}

.ready-overlay.show {
  opacity: 1;
  visibility: visible;
}

.ready-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.ready-text {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 8rem);
  color: #ffffff;
  text-shadow: 
    0 0 5px var(--primary-neon),
    0 0 10px var(--primary-neon),
    0 0 20px var(--primary-neon),
    0 2px 4px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: clamp(4px, 2vw, 12px);
  position: relative;
  /* 그라데이션 효과 제거하여 선명도 향상 */
  filter: none;
  /* 기본 애니메이션을 제거하고 JavaScript에서 동적으로 제어 */
}

/* ::before 요소 제거하여 텍스트 선명도 향상 */

/* 숫자 카운트다운용 긴장감 넘치는 바운스 애니메이션 */
.ready-text.bounce {
  animation: readyCountdownBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
  animation-fill-mode: both !important;
}

.ready-text.ready-state {
  animation: readyPulse 1.5s ease-in-out infinite !important;
  animation-fill-mode: both !important;
}

@keyframes readyCountdownBounce {
  0% { 
    transform: scale(0.1) translateY(150px) rotate(-15deg);
    opacity: 0;
    color: #ff006e !important;
    text-shadow: 
      0 0 30px #ff006e,
      0 0 60px #ff006e,
      0 0 90px #ff006e !important;
  }
  15% {
    transform: scale(2.2) translateY(-60px) rotate(8deg);
    opacity: 0.7;
    color: #ffbe0b !important;
    text-shadow: 
      0 0 40px #ffbe0b,
      0 0 80px #ffbe0b,
      0 0 120px #ffbe0b !important;
  }
  35% {
    transform: scale(0.5) translateY(40px) rotate(-5deg);
    opacity: 1;
    color: #fb5607 !important;
    text-shadow: 
      0 0 50px #fb5607,
      0 0 100px #fb5607,
      0 0 150px #fb5607 !important;
  }
  55% {
    transform: scale(1.8) translateY(-30px) rotate(4deg);
    color: #00f3ff !important;
    text-shadow: 
      0 0 60px #00f3ff,
      0 0 120px #00f3ff,
      0 0 180px #00f3ff !important;
  }
  75% {
    transform: scale(0.8) translateY(15px) rotate(-2deg);
    color: #8338ec !important;
    text-shadow: 
      0 0 50px #8338ec,
      0 0 100px #8338ec,
      0 0 150px #8338ec !important;
  }
  90% {
    transform: scale(1.15) translateY(-8px) rotate(1deg);
    color: #ffffff !important;
    text-shadow: 
      0 0 15px var(--primary-neon),
      0 0 30px var(--primary-neon),
      0 0 60px var(--primary-neon) !important;
  }
  100% { 
    transform: scale(1) translateY(0) rotate(0deg);
    opacity: 1;
    color: #ffffff !important;
    text-shadow: 
      0 0 10px var(--primary-neon),
      0 0 20px var(--primary-neon),
      0 0 40px var(--primary-neon),
      0 4px 8px rgba(0, 0, 0, 0.8) !important;
  }
}

@keyframes readyPulse {
  0%, 100% { 
    transform: scale(1) translateY(0px);
    opacity: 0.9;
  }
  50% { 
    transform: scale(1.08) translateY(-8px);
    opacity: 1;
    text-shadow: 
      0 0 8px var(--primary-neon),
      0 0 15px var(--primary-neon),
      0 0 25px var(--primary-neon),
      0 3px 6px rgba(0, 0, 0, 0.8);
  }
}

/* 사용하지 않는 애니메이션들 제거 */

@keyframes readyBackgroundRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ready-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: 
    radial-gradient(circle, rgba(0, 243, 255, 0.3) 0%, transparent 30%),
    radial-gradient(circle, rgba(131, 56, 236, 0.2) 20%, transparent 60%);
    transform: translate(-50%, -50%);
  animation: readyGlowRotate 4s linear infinite, readyGlowPulse 2s ease-in-out infinite alternate;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(1px);
}

@keyframes readyGlowRotate {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  25% { transform: translate(-50%, -50%) rotate(90deg) scale(1.1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
  75% { transform: translate(-50%, -50%) rotate(270deg) scale(1.1); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes readyGlowPulse {
  0% { opacity: 0.5; }
  100% { opacity: 0.8; }
}

/* 게임 오버 오버레이 */
.game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 0, 110, 0.1) 0%,
    rgba(0, 0, 0, 0.9) 70%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
    opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
  backdrop-filter: blur(15px);
  }

.game-over-overlay.show {
  opacity: 1;
  visibility: visible;
}

.game-over-content {
  text-align: center;
  position: relative;
  animation: gameOverAppear 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes gameOverAppear {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.game-over-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: gameOverBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--secondary-neon));
}

@keyframes gameOverBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
}

.game-over-text {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 3rem;
  color: var(--secondary-neon);
  text-shadow: 
    0 0 20px var(--secondary-neon),
    0 0 40px var(--secondary-neon);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  animation: gameOverGlow 2s ease-in-out infinite;
}

@keyframes gameOverGlow {
  0%, 100% { 
    text-shadow: 
      0 0 20px var(--secondary-neon),
      0 0 40px var(--secondary-neon);
  }
  50% { 
    text-shadow: 
      0 0 30px var(--secondary-neon),
      0 0 60px var(--secondary-neon),
      0 0 90px var(--secondary-neon);
  }
}

.game-over-subtitle {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.2rem;
  color: var(--text-light);
  opacity: 0.8;
  margin-bottom: 2rem;
}

.game-over-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.game-over-effects::before,
.game-over-effects::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--secondary-neon);
  border-radius: 50%;
  animation: gameOverSparkle 3s ease-in-out infinite;
  box-shadow: 0 0 10px var(--secondary-neon);
}

.game-over-effects::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.game-over-effects::after {
  bottom: 20%;
  right: 10%;
  animation-delay: 1.5s;
}

@keyframes gameOverSparkle {
  0%, 100% { 
    opacity: 0;
    transform: scale(0) rotate(0deg); 
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg); 
  }
}

/* 비디오 및 캔버스 */
.game-video,
.game-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 85%;
  transform: translate(-50%, -50%) scaleX(-1);
  border-radius: 15px;
  border: 2px solid rgba(0, 243, 255, 0.3);
  box-shadow: 
    0 0 40px rgba(0, 243, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: var(--transition-smooth);
}

.game-video:hover,
.game-canvas:hover {
  border-color: var(--primary-neon);
  box-shadow: 
    0 0 60px rgba(0, 243, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 점프 카운터 */
.jump-counter {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20vw;  /* 반응형 단위로 변경 */
  height: 20vw;  /* 반응형 단위로 변경 */
  max-width: 240px;  /* 최대 크기 제한 */
  max-height: 240px;  /* 최대 크기 제한 */
  min-width: 120px;  /* 최소 크기 보장 */
  min-height: 120px;  /* 최소 크기 보장 */
  z-index: 50;
  /* 원형 반투명 배경 추가 */
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.15) 0%,
    rgba(131, 56, 236, 0.15) 100%
  );
  border: 2px solid rgba(0, 243, 255, 0.3);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 30px rgba(0, 243, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.counter-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(0, 243, 255, 0.2);
  border-radius: 50%;
  transform: rotate(-90deg);
}

.ring-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top: 4px solid var(--primary-neon);
  border-radius: 50%;
  animation: ringRotate 2s linear infinite;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.counter-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* Speed Sprint와 Speed Endurance용 반반 표시 */
.half-count {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 3rem);  /* 반응형 크기 (최소, 기본, 최대) */
  color: var(--text-glow);
  text-shadow: 0 0 20px var(--primary-neon);
  animation: counterPulse 0.3s ease-in-out;
  display: block;
}

.total-count {
  font-family: 'Orbitron', monospace;
  font-weight: 400;
  font-size: clamp(0.9rem, 1.5vw, 1.8rem);  /* 반응형 크기 (최소, 기본, 최대) */
  color: var(--text-light);
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* Basic Jumps와 Double Unders용 전체 표시 */
.jump-counter.full-count-mode .half-count {
  display: none;  /* 반반 숫자 숨기기 */
}

.jump-counter.full-count-mode .total-count {
  font-size: clamp(1.8rem, 3vw, 3.6rem);  /* 반응형 크기 (최소, 기본, 최대) */
  color: #fff;
  opacity: 1;
  margin-top: 0;
}

.jump-counter.full-count-mode .counter-content {
  justify-content: center;
  align-items: center;
  display: flex;
}

@keyframes counterPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.counter-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24vw;  /* 반응형 단위로 변경 */
  height: 24vw;  /* 반응형 단위로 변경 */
  max-width: 280px;  /* 최대 크기 제한 */
  max-height: 280px;  /* 최대 크기 제한 */
  min-width: 140px;  /* 최소 크기 보장 */
  min-height: 140px;  /* 최소 크기 보장 */
  background: radial-gradient(
    circle,
    rgba(0, 243, 255, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  animation: counterGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes counterGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* 타이머 디스플레이 */
.timer-display {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(131, 56, 236, 0.2) 100%
  );
  border: 2px solid var(--primary-neon);
  border-radius: 15px;
  padding: 1.5rem;  /* 패딩 조정으로 점프 카운터와 동일한 너비 맞춤 */
  z-index: 50;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 30px rgba(0, 243, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  width: 20vw;  /* 점프 카운터와 동일한 너비 */
  max-width: 240px;  /* 점프 카운터와 동일한 최대 크기 */
  min-width: 120px;  /* 점프 카운터와 동일한 최소 크기 */
  height: auto;
}

.timer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.time-value {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 4rem);  /* 반응형 크기 (최소, 기본, 최대) */
  color: var(--text-glow);
  text-shadow: 0 0 50px var(--primary-neon);
  animation: timerPulse 1s ease-in-out infinite;
  line-height: 1;
  letter-spacing: 0.1em;
}

@keyframes timerPulse {
  0%, 100% { 
    transform: scale(1);
    text-shadow: 0 0 15px var(--primary-neon);
  }
  50% { 
    transform: scale(1.05);
    text-shadow: 0 0 25px var(--primary-neon);
  }
}

.timer-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24vw;  /* 점프 카운터 글로우와 동일 */
  height: 24vw;  /* 점프 카운터 글로우와 동일 */
  max-width: 280px;  /* 점프 카운터 글로우와 동일 */
  max-height: 280px;  /* 점프 카운터 글로우와 동일 */
  min-width: 140px;  /* 점프 카운터 글로우와 동일 */
  min-height: 140px;  /* 점프 카운터 글로우와 동일 */
  background: radial-gradient(
    circle,  /* ellipse에서 circle로 변경 */
    rgba(0, 243, 255, 0.1) 0%,
    transparent 70%
  );
    transform: translate(-50%, -50%);
  animation: timerGlow 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes timerGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* 제어 버튼 그룹 */
.button-group {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 50;
}

.game-btn {
  background: linear-gradient(
    145deg,
    rgba(0, 243, 255, 0.2) 0%,
    rgba(131, 56, 236, 0.2) 100%
  );
  border: 2px solid var(--primary-neon);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: var(--text-light);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  text-transform: uppercase;
    cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  backdrop-filter: blur(10px);
  min-width: 100px;
}

.game-btn:hover {
  border-color: var(--secondary-neon);
  color: var(--secondary-neon);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 32px rgba(0, 243, 255, 0.4);
}

.game-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.start-btn {
  border-color: var(--success-neon);
}

.start-btn:hover {
  border-color: var(--success-neon);
  color: var(--success-neon);
  box-shadow: 0 8px 32px rgba(58, 134, 255, 0.4);
}

.reset-btn {
  border-color: var(--warning-neon);
}

.reset-btn:hover {
  border-color: var(--warning-neon);
  color: var(--warning-neon);
  box-shadow: 0 8px 32px rgba(255, 190, 11, 0.4);
}

.game-btn .btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.game-btn:hover .btn-glow {
  left: 100%;
}

/* 스낵 로그 */
.snag-log {
  position: absolute;
  width: 140px;  /* 폭을 더 넓게 */
  height: 520px;  /* 2배 크기 */
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);  /* 세로 중앙 정렬 */
  background: linear-gradient(
    145deg,
    rgba(255, 0, 110, 0.15) 0%,
    rgba(131, 56, 236, 0.15) 100%
  );
  border: 2px solid var(--secondary-neon);
  border-radius: 12px;
  padding: 12px;  /* 패딩 조정 */
  z-index: 50;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(255, 0, 110, 0.3);
  display: flex;
  flex-direction: column;
    opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  }

.snag-log.show {
    opacity: 1;
  visibility: visible;
}

/* 헤더 */
.snag-bar-header {
  text-align: center;
  margin-bottom: 12px;  /* 여백 조정 */
}

.snag-count {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.1rem;  /* 폰트 크기 조정 */
  color: var(--secondary-neon);
  text-shadow: 0 0 8px var(--secondary-neon);
  line-height: 1.2;  /* 줄 간격 조정 */
}

.snag-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;  /* 폰트 크기 조정 */
  color: var(--text-light);
  opacity: 0.8;
  margin-top: 2px;  /* 여백 조정 */
  line-height: 1.2;  /* 줄 간격 조정 */
}

/* 슬롯 컨테이너 */
.snag-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;  /* 2배 크기 */
  justify-content: space-between;
}

/* 개별 슬롯 */
.snag-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;  /* 패딩 조정 */
  border-radius: 6px;  /* 라운드 조정 */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  min-height: 36px;  /* 높이 조정 */
}

.snag-slot.active {
  background: linear-gradient(90deg, var(--secondary-neon)40, var(--secondary-neon)20);
  border-color: var(--secondary-neon);
  box-shadow: 0 0 8px rgba(255, 0, 110, 0.4);
}

.snag-slot.warning.active {
  background: linear-gradient(90deg, #ff880040, #ff880020);
  border-color: #ff8800;
  box-shadow: 0 0 8px rgba(255, 136, 0, 0.4);
}

.snag-slot.danger.active {
  background: linear-gradient(90deg, #ff444440, #ff444420);
  border-color: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
  animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% { 
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
  }
  50% { 
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.8);
  }
}

.slot-indicator {
  width: 12px;  /* 2배 크기 */
  height: 12px;  /* 2배 크기 */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.snag-slot.active .slot-indicator {
  background: var(--secondary-neon);
  box-shadow: 0 0 4px var(--secondary-neon);
}

.snag-slot.warning.active .slot-indicator {
  background: #ff8800;
  box-shadow: 0 0 4px #ff8800;
}

.snag-slot.danger.active .slot-indicator {
  background: #ff4444;
  box-shadow: 0 0 4px #ff4444;
}

.slot-number {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;  /* 폰트 크기 조정 */
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  line-height: 1;  /* 줄 간격 조정 */
}

.snag-slot.active .slot-number {
  color: white;
  text-shadow: 0 0 4px currentColor;
}

.snag-log::-webkit-scrollbar {
  width: 4px;
}

.snag-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.snag-log::-webkit-scrollbar-thumb {
  background: var(--secondary-neon);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--secondary-neon);
}

/* 랜드스케이프 모드 조정 */
body.landscape-mode .game-video,
body.landscape-mode .game-canvas {
  transform: translate(-50%, -50%) rotate(90deg) scaleY(-1);
  height: auto;
  width: 55%;
}

body.landscape-mode .jump-counter {
  width: 32vw;  /* 16vw의 2배 */
  height: 32vw;  /* 정사각형 유지, 16vw의 2배 */
  max-width: 400px;  /* 200px의 2배 */
  max-height: 400px;  /* 200px의 2배 */
  min-width: 200px;  /* 100px의 2배 */
  min-height: 200px;  /* 100px의 2배 */
  top: 50%;
  left: 2rem;
  transform: translateY(-50%);  /* 세로 중앙 정렬 */
}

body.landscape-mode .half-count {
  font-size: clamp(2.4rem, 8vw, 5rem);  /* 2배 크기 */
}

body.landscape-mode .total-count {
  font-size: clamp(1.6rem, 5vw, 3rem);  /* 2배 크기 */
  margin-top: 1vw;  /* 하프카운트와 토탈카운트 사이에 여백 추가 */
}

body.landscape-mode .jump-counter.full-count-mode .total-count {
  font-size: clamp(3rem, 9vw, 6rem);  /* 2배 크기 */
}

body.landscape-mode .timer-display {
  top: calc(50% + 16vw + 2rem);  /* 줄넘기 카운터 아래 위치 (중앙 + 카운터 반높이 + 여백) */
  left: 2rem;  /* 줄넘기 카운터와 같은 좌측 여백 */
  right: auto;
  transform: none;
  width: 32vw;  /* 줄넘기 카운터와 같은 너비 */
  max-width: 400px;  /* 줄넘기 카운터와 같은 최대 너비 */
  min-width: 200px;  /* 줄넘기 카운터와 같은 최소 너비 */
  height: 10vh;
  padding: 1.5rem;
}

body.landscape-mode .time-value {
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0.1em;
}

body.landscape-mode .button-group {
  height: 2vw;
  bottom: 3rem;  /* 2rem → 3rem으로 하단 여백 증가 */
  left: 50%;
  right: auto;
  transform: translateX(-50%);  /* 웹캠화면 하단 중앙에 위치 */
  flex-direction: row;
}

body.landscape-mode .game-btn {
  padding: 0.45vw 1.5vw;  /* 50% 증가 (0.3vw → 0.45vw, 1vw → 1.5vw) */
  font-size: 1.8vw;       /* 50% 증가 (1.2vw → 1.8vw) */
  display: flex;
    align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 3vw;        /* 최소 높이 설정으로 버튼 크기 보장 */
  line-height: 1;         /* 폰트의 기본 line-height 제거로 정확한 중앙 정렬 */
}

body.landscape-mode .settings-trigger {
  width: 3vw;
  height: 3vw;
  top: auto;
  bottom: 2rem;  /* 하단으로 이동 */
  right: 2rem;   /* 오른쪽 하단으로 이동 */
  left: auto;
  transform: none;
}

body.landscape-mode .snag-log {
  top: 50%;  /* 오른쪽 중앙 */
  right: 2rem;
  left: auto;
  transform: translateY(-50%);  /* 세로 중앙 정렬 */
}

/* 포트레이트 모드 - 웹캠/캔버스는 화면 최대한 채우기, UI 요소만 위치 변경 */
body:not(.landscape-mode) .game-video,
body:not(.landscape-mode) .game-canvas {
  transform: translate(-50%, -50%) rotate(90deg) scaleY(-1);
  /* 90도 회전된 상태에서 화면을 거의 전체 채우도록 설정 */
  width: 95vh;   /* 세로 화면의 높이가 회전 후 너비가 됨 */
  height: 98vw;  /* 세로 화면의 너비가 회전 후 높이가 됨 */
  max-width: none;
  max-height: none;
}

body:not(.landscape-mode) .jump-counter {
  width: 25vw;
  height: 25vw;
  max-width: 280px;
  max-height: 280px;
  min-width: 160px;
  min-height: 160px;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

body:not(.landscape-mode) .timer-display {
  top: calc(1rem + 25vw + 1rem);  /* 점프 카운터 아래 위치 - 반응형 크기 반영 */
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 25vw;  /* 세로모드에서 점프 카운터와 일치 */
  max-width: 280px;  /* 세로모드 점프 카운터와 일치 */
  min-width: 160px;  /* 세로모드 점프 카운터와 일치 */
  height: auto;
  z-index: 100;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 1.5rem;  /* 좌우 패딩 제거 */
}

body:not(.landscape-mode) .button-group {
  top: auto;
  bottom: 1rem;  /* 화면 최하단에 위치 */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 1rem;
  z-index: 100;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.5rem;
}

body:not(.landscape-mode) .settings-trigger {
  /* 웹캠 화면 오른쪽 상단 꼭지점 안쪽에 위치 */
  top: calc((100vh - 95vh) / 2 + 1rem);  /* 웹캠 상단 여백 + 1rem */
  right: calc((100vw - 98vw) / 2 + 1rem);  /* 웹캠 우측 여백 + 1rem */
  left: auto;
  transform: none;
  z-index: 101;  /* 웹캠보다 위에 표시 */
  background: rgba(0, 0, 0, 0.5);  /* 더 진한 배경으로 가시성 향상 */
  backdrop-filter: blur(10px);
  border: 2px solid rgba(0, 243, 255, 0.6);  /* 테두리 강화 */
}

body:not(.landscape-mode) .snag-log {
  /* 세로화면에서도 오른쪽 중앙 */
  top: 50%;
  right: 2rem;
  left: auto;
  transform: translateY(-50%);  /* 세로 중앙 정렬 */
  z-index: 100;  /* 웹캠과 동일한 z-index */
}



body:not(.landscape-mode) .half-count {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

body:not(.landscape-mode) .total-count {
  font-size: clamp(1.2rem, 2.4vw, 2rem);
}

body:not(.landscape-mode) .jump-counter.full-count-mode .total-count {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

/* 세로화면 모드의 time-value는 기본 스타일과 동일하므로 제거 */

body:not(.landscape-mode) .game-btn {
  padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

/* 확장된 플레이어 컨테이너 */
.player-container.expanded {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  border-radius: 0;
  box-shadow: none;
}

.player-container.expanded .game-video,
.player-container.expanded .game-canvas {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
}

/* 미디어 쿼리 - 반응형 디자인 */
@media (max-width: 1024px) {
  .settings-panel {
    width: 320px;
  }
  
  .jump-counter {
    width: 22vw;
    height: 22vw;
    max-width: 200px;
    max-height: 200px;
  }
  
  .timer-display {
    padding: 1rem;
    width: 22vw;  /* 1024px에서 점프 카운터와 일치 */
    max-width: 200px;  /* 1024px에서 점프 카운터와 일치 */
    min-width: 110px;  /* 1024px에서 점프 카운터와 일치 */
  }
  
  .game-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .settings-panel {
    width: 280px;
  }
  
  .ready-text {
    font-size: 3rem;
  }
  
  .game-over-text {
    font-size: 2rem;
  }
  
  .jump-counter {
    width: 26vw;
    height: 26vw;
    max-width: 160px;
    max-height: 160px;
  }
  
  .half-count {
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  }
  
  .total-count {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
  }
  
  .jump-counter.full-count-mode .total-count {
    font-size: clamp(2rem, 5.5vw, 3.2rem);
  }
  
  .timer-display {
    padding: 0.75rem;
    width: 26vw;  /* 768px에서 점프 카운터와 일치 */
    max-width: 160px;  /* 768px에서 점프 카운터와 일치 */
    min-width: 80px;  /* 768px에서 점프 카운터와 일치 */
  }
  
  /* 768px 이하의 time-value는 기본 스타일과 동일하므로 제거 */
  
  .button-group {
    gap: 0.75rem;
  }
  
  body:not(.landscape-mode) .button-group {
    top: auto;
    bottom: 1rem;  /* 768px에서도 화면 최하단에 위치 */
  }
  
  .event-indicator {
    font-size: 2rem;  /* 768px에서 폰트 크기 조정 */
    padding: 1.5rem 1rem;  /* 패딩 조정 */
    letter-spacing: 2px;
    width: calc(100vw - 4rem);  /* 768px에서 화면 너비에 맞춤 */
    max-width: calc(100vw - 4rem);
    min-width: unset;
  }
  
  body:not(.landscape-mode) .event-indicator {
    width: 98vw;  /* 세로모드는 웹캠 너비 유지 */
    padding: 1rem 0.5rem;  /* 더 작은 패딩 */
  }
  
  .game-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-width: 80px;
  }
  
  .snag-log {
    width: 120px;  /* 폭 조정 */
    height: 440px;  /* 2배 크기 유지 */
    right: 1rem;
    padding: 10px;  /* 패딩 조정 */
  }
  
  /* 768px 이하에서 줄걸림 바 폰트 크기 조정 */
  .snag-count {
    font-size: 1rem;  /* 폰트 크기 조정 */
  }
  
  .snag-title {
    font-size: 0.8rem;  /* 폰트 크기 조정 */
  }
  
  .slot-number {
    font-size: 0.8rem;  /* 폰트 크기 조정 */
  }
}

@media (max-width: 480px) {
  .settings-trigger {
    width: 50px;
    height: 50px;
  }
  
  /* 세로모드 모바일에서 웹캠 안쪽 위치 */
  body:not(.landscape-mode) .settings-trigger {
    top: calc((100vh - 95vh) / 2 + 0.75rem);  /* 모바일에서 약간 더 안쪽 */
    right: calc((100vw - 98vw) / 2 + 0.75rem);
    width: 50px;
    height: 50px;
  }
  
  /* 세로모드 모바일에서도 오른쪽 중앙 */
  body:not(.landscape-mode) .snag-log {
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 110px;  /* 폭 조정 */
    height: 400px;  /* 2배 크기 유지 */
    padding: 8px;  /* 패딩 조정 */
  }
  
  /* 480px 이하에서 줄걸림 바 폰트 크기 조정 */
  .snag-count {
    font-size: 0.9rem;  /* 폰트 크기 조정 */
  }
  
  .snag-title {
    font-size: 0.7rem;  /* 폰트 크기 조정 */
  }
  
  .slot-number {
    font-size: 0.7rem;  /* 폰트 크기 조정 */
  }
  
  .jump-counter {
    width: 30vw;
    height: 30vw;
    max-width: 140px;
    max-height: 140px;
    min-width: 100px;
    min-height: 100px;
    top: 1rem;
  }
  
  .half-count {
    font-size: clamp(1.3rem, 6vw, 2rem);
  }
  
  .total-count {
    font-size: clamp(0.9rem, 3.5vw, 1.4rem);
  }
  
  .jump-counter.full-count-mode .total-count {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }
  
  .timer-display {
    bottom: 1rem;
    padding: 0.5rem;
    width: 30vw;  /* 480px에서 점프 카운터와 일치 */
    max-width: 140px;  /* 480px에서 점프 카운터와 일치 */
    min-width: 100px;  /* 480px에서 점프 카운터와 일치 */
  }
  
  /* 480px 이하의 time-value는 기본 스타일과 동일하므로 제거 */
  
  .button-group {
    top: auto;
    bottom: 1rem;  /* 모바일에서도 화면 최하단에 위치 */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.5rem;
  }
  
  .event-indicator {
    font-size: 1.5rem;  /* 모바일에서 폰트 크기 조정 */
    padding: 1rem 0.5rem;  /* 모바일용 패딩 조정 */
    letter-spacing: 1.5px;
    width: calc(100vw - 2rem);  /* 480px에서 화면 너비에 맞춤 */
    max-width: calc(100vw - 2rem);
    min-width: unset;
  }
  
  body:not(.landscape-mode) .event-indicator {
    width: 98vw;  /* 세로모드는 웹캠 너비 유지 */
    padding: 0.75rem 0.25rem;  /* 더 작은 패딩 */
  }
  
  .game-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    min-width: 60px;
  }
  
  .ready-text {
    font-size: 2rem;
    letter-spacing: 4px;
  }
  
  .game-over-text {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }
}

/* 성능 최적화 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* 다크 모드 호환성 */
@media (prefers-color-scheme: dark) {
  /* 이미 다크 테마이므로 추가 조정 불필요 */
}

/* 움직임 줄이기 설정 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-particles::before,
  .floating-particles::after {
    display: none;
  }
  
  .ring-progress {
    animation: none;
  }
}

/* 고대비 모드 추가 지원 */
@media (prefers-contrast: high) {
  .game-video,
  .game-canvas {
    border-width: 4px;
    border-color: var(--primary-neon);
  }
  
  .jump-counter .counter-ring,
  .timer-display,
  .game-btn {
    border-width: 3px;
  }
  
  .challenge-panel,
  .modal-content,
  .settings-panel {
    border-width: 4px;
  }
}