* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html,
body {
  background-color: #ff0077;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes active-border-glow {
  0% {
    box-shadow: 0 0 30px 10px rgba(0, 220, 255, 0.5), 0 0 0 6px rgba(0,0,0,0.2) inset;
    border: 3px solid rgba(0, 200, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 50px 18px rgba(0, 255, 255, 0.8), 0 0 0 10px rgba(0,0,0,0.2) inset;
    border: 3px solid rgba(0, 255, 255, 0.8);
  }
}

@keyframes border-gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes video-zoom-center {
  0% {
    width: 250%;
    height: 250%;
    transform: translate(0, 0);
    z-index: 1;
  }
  10%, 90% {
    width: 90%;
    height: 90%;
    transform: translate(-50%, -50%);
    z-index: 999;
  }
  100% {
    width: 0%;
    height: 0%;
    transform: translate(0, 0);
    z-index: 1;
  }
}

@keyframes medal-stamp {
  0% {
    transform: scale(0) translateY(-100px);
    opacity: 0;
  }
  20%, 95% {
    transform: scale(3) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 0;
  }
}

@keyframes rank-display {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  50% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@keyframes jumps-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes event-display-glow {
  0% {
    box-shadow: 
      0 0 20px rgba(0, 150, 255, 0.6),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
    text-shadow: 
      0 0 10px rgba(255, 255, 255, 0.8),
      0 2px 4px rgba(0, 0, 0, 0.8);
  }
  100% {
    box-shadow: 
      0 0 30px rgba(0, 150, 255, 0.9),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
    text-shadow: 
      0 0 15px rgba(255, 255, 255, 1),
      0 2px 6px rgba(0, 0, 0, 0.9);
  }
}

#grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 1vw;
  gap: 1vw;
  background-color: #000000;
  justify-items: center;
  align-items: center;
  position: relative;
}

#grid-container:fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0;
  padding: 1vw;
  z-index: 9999;
}

#grid-container:-webkit-full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0;
  padding: 1vw;
  z-index: 9999;
}

#grid-container:-moz-full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0;
  padding: 1vw;
  z-index: 9999;
}

#grid-container:-ms-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0;
  padding: 1vw;
  z-index: 9999;
}

.player-container {
  position: relative;
  background-color: #1e2833;
  border: 3px solid #666666;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9 / 16;
  width: 100%;
  height: 100%;
  transition: all 0.5s ease;
  z-index: 0;
}

#player-1,
#player-2 {
  background-color: rgba(0, 0, 0, 0.95);
  position: relative;
}

#player-3,
#player-4 {
  border: none !important;
}

.player-container.active-player {  
  border-radius: 8px;
  box-shadow: 0 0 30px 10px rgba(0, 220, 255, 0.5), 0 0 0 6px rgba(0,0,0,0.2) inset;
  background-clip: padding-box;
  position: relative;
  z-index: 1;
  animation: none;
  background-image: linear-gradient(135deg, rgba(0, 50, 150, 0.5), rgba(0, 200, 255, 0.3));
}

.player-container.active-player.glowing {
  animation: active-border-glow 0.2s infinite alternate;
  position: relative;
  z-index: 2;
}

.player-container.active-player.glowing::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
  border-radius: 8px;
  z-index: -1;
  background: linear-gradient(135deg, #00c3ff, #0047ff, #00fff0, #00c3ff);
  background-size: 400% 400%;
  filter: blur(4px);
  opacity: 0.7;
  animation: border-gradient-move 6s linear infinite;
  pointer-events: none;
}

.player-container.expanded .scalable {
  transform: scale(2) !important;
  transform-origin: center;
  transition: transform 0.5s ease-in-out;
}

.player-container.expanded .medal-overlay {
  transform: scale(2.5) !important;
  transform-origin: center;
  transition: transform 0.5s ease-in-out;
}

.player-container.expanded .rank-overlay {
  font-size: 3vw !important;
  padding: 1vw !important;
}

.player-container.expanded .rank-overlay.default-rank {
  font-size: 2vw !important;
  padding: 1vw !important;
}

.medal {
  margin-right: 10px;
}

.gold-border {
  border: 40px solid #ffbb00 !important;
  padding: 0 !important;
}

.silver-border {
  border: 40px solid #e6e6e6 !important;
  padding: 0 !important;
}

.bronze-border {
  border: 40px solid #ad8359 !important;
  padding: 0 !important;
}

.gold-border .rank-overlay,
.silver-border .rank-overlay,
.bronze-border .rank-overlay {
  padding: 1rem 1rem;
  top: 1%;
  left: 2%;
  font-size: 3rem;
  transform: translate(-10%, -10%);
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.gold-border-overlay {
  background-color: rgba(255, 223, 0, 0.5);
}

.silver-border-overlay {
  background-color: rgba(192, 192, 192, 0.5);
}

.medal-overlay {
  position: absolute;
  top: 5%;
  right: 10%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  animation: medal-stamp 9.5s ease-in-out;
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#video-element,
#canvas-element,
#video-element-2,
#canvas-element-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg) scaleY(-1);
  height: 55%;
  width: auto;
  object-fit: contain;
}

.rank-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  height: 55%;
  width: auto;
  object-fit: contain;
}

#event-display {
  position: absolute;
  top: 52%;
  left: 0;
  width: 100%;
  padding: 1.5vh 0;
  background: linear-gradient(135deg, 
    rgba(0, 150, 255, 0.9) 0%, 
    rgba(0, 100, 200, 0.9) 25%, 
    rgba(50, 50, 150, 0.9) 50%, 
    rgba(100, 0, 200, 0.9) 75%, 
    rgba(150, 0, 255, 0.9) 100%);
  border-top: 3px solid rgba(255, 255, 255, 0.8);
  border-bottom: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 0 20px rgba(0, 150, 255, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #fff;
  font-family: 'Wallpoet', cursive;
  font-size: 3vh;
  font-weight: bold;
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 10;
  animation: event-display-glow 3s ease-in-out infinite alternate;
}

body.event-ss #event-display {
  background: linear-gradient(135deg, 
    rgba(0, 255, 150, 0.9) 0%, 
    rgba(0, 200, 100, 0.9) 25%, 
    rgba(50, 150, 50, 0.9) 50%, 
    rgba(100, 200, 0, 0.9) 75%, 
    rgba(150, 255, 0, 0.9) 100%);
  box-shadow: 
    0 0 20px rgba(0, 255, 150, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

body.event-du #event-display {
  background: linear-gradient(135deg, 
    rgba(255, 100, 0, 0.9) 0%, 
    rgba(255, 150, 0, 0.9) 25%, 
    rgba(255, 200, 50, 0.9) 50%, 
    rgba(255, 150, 100, 0.9) 75%, 
    rgba(255, 100, 150, 0.9) 100%);
  box-shadow: 
    0 0 20px rgba(255, 150, 0, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

#ready-overlay {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  font-size: 8vw;
  font-weight: bold;
  color: #fff;
  z-index: 2;
  display: none;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

#totalJumpCountCircle {
  position: absolute;
  top: 1%;
  left: 2%;
  border-radius: 15%;
  width: 15vw;
  height: 10vw;
  border: 0.5vw solid rgba(0, 238, 255, 0.8);
  background-color: rgba(0, 225, 255, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  z-index: 200;
}

#halfJumpCount {
  font-family: 'Graduate', cursive;
  color: #FFF;
  font-size: 4vw;
  line-height: 1;
  margin-bottom: 0.5vw;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#totalJumpCount {
  font-family: 'Graduate', cursive;
  font-size: 2.5vw;
  color: rgba(255, 225, 255, 0.8);
  line-height: 1;
  margin-top: -0.4vw;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#totalJumpCountCircle-2 {
  position: absolute;
  top: 1%;
  right: 2%;
  border-radius: 15%;
  width: 15vw;
  height: 10vw;
  border: 0.5vw solid rgba(0, 238, 255, 0.8);
  background-color: rgba(0, 225, 255, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  z-index: 200;
}

#halfJumpCount-2 {
  font-family: 'Graduate', cursive;
  color: #FFF;
  font-size: 4vw;
  line-height: 1;
  margin-bottom: 0.5vw;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#totalJumpCount-2 {
  font-family: 'Graduate', cursive;
  font-size: 2.5vw;
  color: rgba(255, 225, 255, 0.8);
  line-height: 1;
  margin-top: -0.4vw;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#time-display {
  position: absolute;
  top: 2.5%;
  right: 3%;
  margin: 0;
  transform: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Wallpoet', cursive;
  font-variant-numeric: tabular-nums;
  font-size: 6vw;
  text-align: center;
  z-index: 150;
  min-width: 50%;
  width: 55%;
  height: auto;
  line-height: 1.2;
  padding: 0.5vw 1vw;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
  background: transparent !important;
  max-width: calc(100% - 17vw);
}

#time-display::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(to right, #00aaff 0%, #ff0000 100%);
  transition: width 0.1s linear;
  border-radius: 10px;
  z-index: -1;
}

#time-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: -2;
  border-radius: 10px;
}

#time-display .integer-part {
  text-align: right;
  padding-right: 0.2vw;
  font-size: 100%;
  min-width: 2.5ch;
  width: 2.5ch;
  margin-left: -1vw;
}

#time-display .time-separator {
  text-align: center;
  font-family: 'Wallpoet', cursive;
  font-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: 0.6ch;
}

#time-display .decimal-digits {
  text-align: left;
  font-size: 100%;
  font-family: 'Wallpoet', cursive;
  letter-spacing: 0.1vw;
  padding-left: 0.2vw;
  display: flex;
  align-items: center;
  min-width: 2ch;
  width: 2ch;
  margin-left: -0.2vw;
}

#time-display-2 {
  position: absolute;
  top: 2.5%;
  left: 3% !important;
  margin: 0;
  transform: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Wallpoet', cursive;
  font-variant-numeric: tabular-nums;
  font-size: 6vw;
  text-align: left;
  z-index: 150;
  min-width: 50%;
  width: 55%;
  height: auto;
  line-height: 1.2;
  padding: 0.5vw 1vw;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  display: flex;
  justify-content: flex-start !important;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
  background: transparent !important;
  max-width: calc(100% - 17vw);
}

#time-display-2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(to right, #00aaff 0%, #ff0000 100%);
  transition: width 0.1s linear;
  border-radius: 10px;
  z-index: -1;
}

#time-display-2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: -2;
  border-radius: 10px;
}

#time-display-2 .integer-part {
  text-align: right;
  padding-right: 0.2vw;
  font-size: 100%;
  min-width: 2ch;
  width: 2.2ch;
}

#time-display-2 .time-separator {
  text-align: center;
  font-family: 'Wallpoet', cursive;
  font-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.2vw;
  width: 0.8ch;
}

#time-display-2 .decimal-digits {
  text-align: left;
  font-size: 100%;
  font-family: 'Wallpoet', cursive;
  letter-spacing: 0.1vw;
  padding-left: 0.2vw;
  display: flex;
  align-items: center;
  min-width: 2.2ch;
  width: 2.2ch;
}

.button-group {
  position: absolute;
  bottom: 1%;
  left: 1%;
  width: 16vw;
  height: 10vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.button-group button {
  position: absolute;
  border-radius: 10%;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: all 0.3s ease;
  min-height: 60px;
  max-height: 80px;
}

#startButton {
  bottom: 0;
  left: 0;
  font-size: 2vw;
  background-color: #0056b3;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#resetButton {
  bottom: 0;
  left: 0;
  font-size: 2vw;
  background-color: #c82333;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

#startButton:hover {
  background-color: #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.6);
  transform: scale(1.05);
}

#resetButton:hover {
  background-color: #dc3545;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
  transform: scale(1.05);
}

#settings-button {
  position: absolute;
  bottom: 1%;
  right: 2%;
  width: 3.6vw;
  height: 3.6vw;
  min-width: 36px;
  max-width: 54px;
  min-height: 36px;
  max-height: 54px;
  border-radius: 10%;
  background: rgba(150, 150, 150, 0.8);
  cursor: pointer;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: none;
}

.confirm-button {
  background-color: #8400ff;
  color: white;
  padding: 10px 30px;
  font-size: 3rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#fullscreen-message,
#mobile-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#fullscreen-message {
  background-color: black;
}

#fullscreen-content,
#mobile-content {
  text-align: center;
  padding: 20px 120px;
  border: 5px solid #8400ff;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#fullscreen-title {
  color: #707070;
  margin-bottom: 50px;
}

#fullscreen-confirm {
  display: none;
  padding: 10px 30px;
  background-color: #8400ff;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#fullscreen-confirm:hover {
  background-color: #9a00ff;
}

#mobile-message {
  background-color: rgba(0, 0, 0, 1);
  font-family: Arial, sans-serif;
}

#mobile-content {
  text-align: center;
}

.custom-dropdown {
  position: relative;
  display: inline-block;
}

.custom-dropdown-toggle {
  background-color: #fff;
  border: 1px solid #000;
  color: #000;
  padding: 3px 12px 5px 12px;
  cursor: pointer;
  font-size: 4rem;
  display: inline-flex;
  align-items: center;
}

.custom-dropdown-toggle .arrow {
  margin-left: 8px;
  font-size: 2.5rem;
}

.custom-dropdown-menu {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 50%;
  border: 1px solid #000;
  z-index: 1000;
}

.custom-dropdown:hover .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-menu .dropdown-item {
  width: 100%;
  text-align: left;
  padding: 20px 12px;
  background-color: #fff;
  border: none;
  color: #000;
  cursor: pointer;
  font-size: 2rem;
}

.custom-dropdown-menu .dropdown-item:hover {
  background-color: #f0f0f0;
}

.challenge-header {
  text-align: center;
  margin-bottom: 20px;
}

.selector-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
}

.selector-container h1 {
  font-size: 2.5rem !important;
  color: #1b1b1b;
  margin: 0;
  white-space: nowrap;
}

.selector-container h2 {
  margin: 0;
}

.selector-container .custom-dropdown {
  margin: 0 10px;
}

.selector-container .confirm-button {
  margin: 0;
  white-space: nowrap;
}

.jump-count {
  font-family: 'Graduate', cursive;
  font-size: 1.5vw;
  font-weight: normal;
  margin-top: 5px;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#snag-log {
  position: absolute;
  top: 15%;
  left: 3%;
  width: 3vw;
  background-color: rgba(0, 0, 0, 0.5);
  color: red;
  font-size: 1vh;
  padding: 8px;
  border-radius: 8px;
  text-align: right;
  z-index: 999;
  line-height: 1.2;
}

#snag-log-2 {
  position: absolute;
  top: 15%;
  right: 3%;
  width: 3vw;
  background-color: rgba(0, 0, 0, 0.5);
  color: red;
  font-size: 1vh;
  padding: 8px;
  border-radius: 8px;
  text-align: right;
  z-index: 999;
  line-height: 1.2;
}

.snag-log-overlay {
  position: absolute;
  top: 15%;
  left: 1%;
  background-color: rgba(0, 0, 0, 0.5);
  color: red;
  font-size: 0.5vh;
  padding: 8px;
  border-radius: 8px;
  text-align: right;
  z-index: 99;
  line-height: 1.2;
}

.snag-log-overlay .game-over {
  font-size: 1vw;
  color: #ff0000;
  font-weight: bold;
  margin-top: 2px;
}

#settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 70vw;
  height: 50vh;
  background: rgba(255,255,255,0.95);
  box-shadow: 0px 0px 15px rgba(0,0,0,0.5);
  border-radius: 10px;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1001;
  padding: 20px;
  text-align: center;
}

#dim-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  z-index: 999;
}

body.landscape-mode #grid-container {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 100vh;
  align-content: center;
}

body.landscape-mode .player-container {
  aspect-ratio: 16 / 9;
}

body.landscape-mode #video-element,
body.landscape-mode #canvas-element,
body.landscape-mode #video-element-2,
body.landscape-mode #canvas-element-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg) scaleY(-1);
  height: auto;
  width: 55%;
  object-fit: contain;
}

body.landscape-mode .rank-video {
  transform: translate(-50%, -50%) rotate(90deg);
  height: auto;
  width: 55%;
}

body.landscape-mode #totalJumpCountCircle,
body.landscape-mode #totalJumpCountCircle-2 {
  width: 8vw;
  height: 5.5vw;
  border-width: 0.5vw;
}

body.landscape-mode #halfJumpCount,
body.landscape-mode #halfJumpCount-2 {
  font-size: 2vw;
}

body.landscape-mode #totalJumpCount,
body.landscape-mode #totalJumpCount-2 {
  font-size: 1.25vw;
  margin-top: -0.4vw;
}

body.landscape-mode #event-display {
  top: 52%;
  font-size: 2.5vh;
  padding: 1vh 0;
  background: linear-gradient(135deg, 
    rgba(0, 150, 255, 0.9) 0%, 
    rgba(0, 100, 200, 0.9) 25%, 
    rgba(50, 50, 150, 0.9) 50%, 
    rgba(100, 0, 200, 0.9) 75%, 
    rgba(150, 0, 255, 0.9) 100%);
  border-top: 2px solid rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 0 15px rgba(0, 150, 255, 0.6),
    inset 0 0 15px rgba(255, 255, 255, 0.1);
}

body.landscape-mode.event-ss #event-display {
  background: linear-gradient(135deg, 
    rgba(0, 255, 150, 0.9) 0%, 
    rgba(0, 200, 100, 0.9) 25%, 
    rgba(50, 150, 50, 0.9) 50%, 
    rgba(100, 200, 0, 0.9) 75%, 
    rgba(150, 255, 0, 0.9) 100%);
  box-shadow: 
    0 0 15px rgba(0, 255, 150, 0.6),
    inset 0 0 15px rgba(255, 255, 255, 0.1);
}

body.landscape-mode.event-du #event-display {
  background: linear-gradient(135deg, 
    rgba(255, 100, 0, 0.9) 0%, 
    rgba(255, 150, 0, 0.9) 25%, 
    rgba(255, 200, 50, 0.9) 50%, 
    rgba(255, 150, 100, 0.9) 75%, 
    rgba(255, 100, 150, 0.9) 100%);
  box-shadow: 
    0 0 15px rgba(255, 150, 0, 0.6),
    inset 0 0 15px rgba(255, 255, 255, 0.1);
}

body.landscape-mode #time-display {
  top: 0;
  right: 0;
  margin: 0.5vw;
  width: auto;
  height: auto;
  font-size: 2vw;
  padding: 0.3vw 1vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.landscape-mode #time-display::before,
body.landscape-mode #time-display-2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: -2;
  border-radius: 10px;
  padding: 0;
}

body.landscape-mode #time-display::after,
body.landscape-mode #time-display-2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(to right, #00aaff 0%, #ff0000 100%);
  transition: width 0.1s linear;
  border-radius: 10px;
  z-index: -1;
}

body.landscape-mode #time-display .time-separator {
  font-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.1vw;
  width: 0.8ch;
}

body.landscape-mode #time-display .decimal-digits {
  font-size: 100%;
  display: flex;
  align-items: center;
  letter-spacing: 0.05vw;
  min-width: 2.2ch;
  width: 2.2ch;
}

body.landscape-mode #time-display .integer-part {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 100%;
  padding-right: 0.1vw;
  min-width: 2.5ch;
  width: 2.5ch;
}

body.landscape-mode #time-display-2 {
  top: 0;
  left: 0;
  margin: 0.5vw;
  width: auto;
  height: auto;
  font-size: 2vw;
  padding: 0.3vw 0.6vw;
}

body.landscape-mode #time-display-2 .time-separator {
  font-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.1vw;
  width: 0.8ch;
}

body.landscape-mode #time-display-2 .decimal-digits {
  font-size: 100%;
  display: flex;
  align-items: center;
  letter-spacing: 0.05vw;
  min-width: 2.2ch;
  width: 2.2ch;
}

body.landscape-mode #time-display-2 .integer-part {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 100%;
  padding-right: 0.1vw;
  min-width: 2.5ch;
  width: 2.5ch;
  margin-left: 6vw;
}

body.landscape-mode .rank-overlay.default-rank {
  font-size: 1.5rem !important;
  padding: 1vw !important;
}

body.landscape-mode .player-container:not(.gold-border):not(.silver-border):not(.bronze-border) .rank-overlay {
  display: flex;
  flex-direction: column;
  gap: 2.5vh !important;
}

body.landscape-mode .rank-overlay.default-rank .rank-line {
  font-size: 1.8rem !important;
  font-weight: bold;
}

body.landscape-mode .score-line {
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
}

body.landscape-mode .default-rank .score-line {
  margin-top: 3vh !important;
}

body.landscape-mode .default-rank .jump-count {
  font-size: 1.8vw !important;
}

body.landscape-mode #snag-log {
  top: 28%;
}

body.landscape-mode #snag-log-2 {
  top: 28%;
}

/* 기본 스타일 (1080p 이하) */
@media (max-width: 1080px) {
  .selector-container {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .selector-container h1 {
    font-size: 1.8rem !important;
  }
  
  .selector-container .custom-dropdown {
    margin: 0 5px;
  }
  
  .custom-dropdown-toggle {
    font-size: 1.6rem;
    padding: 3px 8px;
  }
  
  #fullscreen-content,
  #mobile-content {
    padding: 20px 50px;
  }
  
  #fullscreen-confirm {
    font-size: 1.5rem;
  }
  
  .confirm-button {
    font-size: 1.5rem;
  }
  

  

}

/* 중간 해상도 세로모드 */
@media (min-width: 1080px) and (max-width: 1920px) and (orientation: portrait) {
  .button-group {
    height: 10vw;
    width: 12vw;
  }

  .button-group button {
    min-height: 56px;
    max-height: 76px;
    font-size: 2vw;
  }

  #startButton,
  #resetButton {
    font-size: 2vw;
  }

  #settings-button {
    width: 5.4vw;
    height: 5.4vw;
    min-width: 72px;
    max-width: 99px;
    min-height: 72px;
    max-height: 99px;
  }

  #totalJumpCountCircle {
    width: 15vw;
    height: 10vw;
    border-width: 0.5vw;
  }

  #halfJumpCount {
    font-size: 4vw;
  }

  #totalJumpCount {
    font-size: 2.5vw;
  }

  body:not(.landscape-mode) .event-du #halfJumpCount,
  body:not(.landscape-mode) .event-bj #halfJumpCount {
    font-size: 6vw;
  }
}

/* 중간 해상도 가로모드 */
@media (min-width: 1080px) and (max-width: 1920px) and (orientation: landscape) {
  body.landscape-mode #totalJumpCountCircle,
  body.landscape-mode #totalJumpCountCircle-2 {
    width: 8vw;
    height: 5.5vw;
    border-width: 0.5vw;
  }

  body.landscape-mode #halfJumpCount,
  body.landscape-mode #halfJumpCount-2 {
    font-size: 2vw;
  }

  body.landscape-mode #totalJumpCount,
  body.landscape-mode #totalJumpCount-2 {
    font-size: 1.25vw;
    margin-top: -0.4vw;
  }

  body.landscape-mode.event-du #halfJumpCount,
  body.landscape-mode.event-bj #halfJumpCount,
  body.landscape-mode.event-du #halfJumpCount-2,
  body.landscape-mode.event-bj #halfJumpCount-2 {
    font-size: 3.5vw;
  }
}

/* FHD 해상도 공통 (세로/가로) */
@media (min-width: 1920px) and (max-width: 2159px) {
  #ranking-table-body td {
    padding-top: calc(0.8vh - 0.2vw);
    padding-bottom: calc(0.8vh - 0.2vw);
  }
  
  #ranking-table-body th {
    padding-top: calc(0.8vh - 0.2vw);
    padding-bottom: calc(0.8vh - 0.2vw);
  }
}

/* 4K 해상도 공통 (세로/가로) */
@media (min-width: 2160px) {
  #ranking-table-body td {
    padding-top: calc(0.8vh + 0.2vw);
    padding-bottom: calc(0.8vh + 0.2vw);
  }
  
  #ranking-table-body th {
    padding-top: calc(0.8vh + 0.2vw);
    padding-bottom: calc(0.8vh + 0.2vw);
  }
}


/* 4K 세로모드 */
@media (min-width: 2160px) and (orientation: portrait) {
  .button-group {
    height: 12vw;
    width: 12vw;
  }

  .button-group button {
    min-height: 70px;
    max-height: 90px;
    font-size: 1.6vw;
  }

  #startButton,
  #resetButton {
    font-size: 1.6vw;
  }

  #settings-button {
    width: 6.3vw;
    height: 6.3vw;
    min-width: 90px;
    max-width: 126px;
    min-height: 90px;
    max-height: 126px;
  }

  #settings-modal .custom-dropdown-toggle,
  #settings-modal button {
    padding: 1.2vw;
  }

  #totalJumpCountCircle {
    width: 15vw;
    height: 10vw;
    border-width: 0.5vw;
  }

  #halfJumpCount {
    font-size: 4vw;
  }

  #totalJumpCount {
    font-size: 2.5vw;
}

  body:not(.landscape-mode) .event-du #halfJumpCount,
  body:not(.landscape-mode) .event-bj #halfJumpCount {
    font-size: 6vw;
  }

  #rank-overlay-3,
  #rank-overlay-4 {
    padding-top: 50% !important;
  }
}

@media (min-width: 2160px) and (orientation: landscape) {
  body.landscape-mode .button-group {
    height: 2vw;
  }

  body.landscape-mode #startButton,
  body.landscape-mode #resetButton {
    padding: 0.3vw 0;
  }

  body.landscape-mode #settings-button {
    height: 2.7vw;
    width: 2.7vw;
  }

  body.landscape-mode #settings-modal .custom-dropdown-toggle,
  body.landscape-mode #settings-modal button {
    padding: 6px;
    font-size: 1.6rem;
  }

  body.landscape-mode .gold-border {
    border-width: 40px !important;
  }

  body.landscape-mode .silver-border {
    border-width: 40px !important;
  }

  body.landscape-mode .bronze-border {
    border-width: 40px !important;
  }

  body.landscape-mode #totalJumpCountCircle,
  body.landscape-mode #totalJumpCountCircle-2 {
    width: 8vw;
    height: 5.5vw;
    border-width: 0.5vw;
  }

  body.landscape-mode #halfJumpCount,
  body.landscape-mode #halfJumpCount-2 {
    font-size: 2vw;
  }

  body.landscape-mode #totalJumpCount,
  body.landscape-mode #totalJumpCount-2 {
    font-size: 1.25vw;
    margin-top: -0.4vw;
   }

  body.landscape-mode.event-du #halfJumpCount,
  body.landscape-mode.event-bj #halfJumpCount,
  body.landscape-mode.event-du #halfJumpCount-2,
  body.landscape-mode.event-bj #halfJumpCount-2 {
    font-size: 3.5vw;
  }

  body.landscape-mode .ranking-rank.rank-1,
  body.landscape-mode .ranking-rank.rank-2,
  body.landscape-mode .ranking-rank.rank-3 {
    font-size: 0.8vw !important;
  }

  body.landscape-mode .ranking-rank.rank-other {
    font-size: 0.7vw !important;
  }

  body.landscape-mode .ranking-total.rank-1,
  body.landscape-mode .ranking-total.rank-2,
  body.landscape-mode .ranking-total.rank-3 {
    font-size: 1.6vw !important;
  }

  body.landscape-mode .ranking-total.rank-other {
    font-size: 0.8vw !important;
  }

  body.landscape-mode .ranking-player {
    font-size: 0.8vw !important;
  }

  body.landscape-mode .ranking-date.rank-1,
  body.landscape-mode .ranking-date.rank-2,
  body.landscape-mode .ranking-date.rank-3 {
    font-size: 0.45vw !important;
  }

  body.landscape-mode .ranking-date.rank-other {
    font-size: 0.4vw !important;
  }

  body.landscape-mode .ranking-cell {
    padding: 0.3vh !important;
  }

  body.landscape-mode .ranking-cell-date {
    padding: 0.15vh !important;
  }
}

@media (max-width: 1920px) and (orientation: landscape) {
  body.landscape-mode .button-group {
    height: 2vw;
  }

  body.landscape-mode #startButton,
  body.landscape-mode #resetButton {
    padding: 0.3vw 0;
  }

  body.landscape-mode #settings-button {
    height: 3vw;
    width: 3vw;
  }

  body.landscape-mode #settings-modal .custom-dropdown-toggle,
  body.landscape-mode #settings-modal button {
    padding: 6px;
    font-size: 1.6rem;
  }

  body.landscape-mode .gold-border {
    border-width: 25px !important;
  }

  body.landscape-mode .silver-border {
    border-width: 25px !important;
  }

  body.landscape-mode .bronze-border {
    border-width: 25px !important;
  }
}

@media screen and (orientation: portrait) {
  #rank-overlay-3,
  #rank-overlay-4 {
    padding-top: 40% !important;
  }
}

@media screen and (orientation: landscape) {
  #rank-overlay-3,
  #rank-overlay-4 {
    padding-top: 10% !important;
  }

  #settings-modal {
    height: 80vh !important;
    width: 85vw !important;
    max-width: 1200px;
  }
  
  #settings-content {
    max-height: calc(80vh - 15vh) !important;
    padding: 1vh 2vh !important;
  }
  
  #settings-content > div {
    margin-bottom: 2vh !important;
  }
  
  #settings-modal img {
    width: 20% !important;
  }
  
  #settings-modal .screen-mode-btn {
    font-size: 1.4rem !important;
    padding: 8px !important;
  }
  
  #new-game {
    font-size: 1.8rem !important;
    padding: 8px !important;
  }
}

body.landscape-mode.event-ss #totalJumpCount,
body.landscape-mode.event-se #totalJumpCount {
  margin-top: -0.5vw;
}

body.landscape-mode.event-ss #totalJumpCountCircle,
body.landscape-mode.event-se #totalJumpCountCircle {
  justify-content: center;
  padding-bottom: 0.5vw;
}

body.landscape-mode.event-ss #halfJumpCount,
body.landscape-mode.event-se #halfJumpCount {
  margin-bottom: 0.2vw;
}

.fixed-width-number {
  font-family: 'Graduate', cursive;
  min-width: 4ch;
  display: inline-block;
  text-align: center;
}

.player3-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: 2vh;
  margin: 0;
}

.player3-total-container {
  background-color: rgba(50, 50, 50, 0.8);
  border-radius: 5px;
  padding: 2vh;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.player3-total-display {
  color: white;
  text-align: center;
  font-weight: bold;
}

.player3-total-number {
  color: #ffcc00;
  font-size: 6vh;
  line-height: 1.2;
}

.player3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5vh;
}

.player3-card {
  background-color: rgba(50, 50, 50, 0.8);
  border-radius: 5px;
  padding: 2vh 2vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.player3-card.player1 {
  border: 1px solid #96CEB4;
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.8), rgba(40, 40, 40, 0.8));
}

.player3-card.player2 {
  border: 1px solid #45B7D1;
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.8), rgba(50, 50, 50, 0.8));
}

.player3-card.player3 {
  border: 1px solid #4ECDC4;
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.8), rgba(60, 60, 60, 0.8));
}

.player3-card.player4 {
  border: 1px solid #FF6B6B;
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.8), rgba(70, 70, 70, 0.8));
}

.player3-title {
  font-size: 3vw;
  font-weight: bold;
  margin-bottom: 1.5vh;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player3-title.player1 { color: #96CEB4; }
.player3-title.player2 { color: #45B7D1; }
.player3-title.player3 { color: #4ECDC4; }
.player3-title.player4 { color: #FF6B6B; }

.player3-count {
  font-size: 6vw;
  font-weight: bold;
  line-height: 1.2;
  padding-bottom: 1vh;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.player3-count.player1 { color: #BEEADB; }
.player3-count.player2 { color: #6ED4EE; }
.player3-count.player3 { color: #76E5DE; }
.player3-count.player4 { color: #FF9F9F; }

.relay-result-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: min(4vh, 32px) min(2vw, 16px);
  gap: min(2vh, 16px);
}

.relay-result-header {
  text-align: center;
  margin-bottom: min(2vh, 16px);
}

.relay-result-title {
  font-size: min(4vw, 32px);
  font-weight: bold;
  color: #fff;
  margin-bottom: min(1vh, 8px);
}

.relay-result-total {
  font-size: min(6vw, 48px);
  font-weight: bold;
  color: #ffcc00;
  text-align: center;
}

.relay-result-snag {
  font-size: 40%;
  color: #ff4444;
  margin-top: 4px;
  font-weight: bold;
}

.relay-result-players {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: min(1.5vh, 12px);
}

.relay-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: min(1.2vh, 10px) min(1.5vw, 12px);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.relay-player-row.player1 {
  background: linear-gradient(135deg, #96CEB4, #BEEADB);
}

.relay-player-row.player2 {
  background: linear-gradient(135deg, #45B7D1, #6ED4EE);
}

.relay-player-row.player3 {
  background: linear-gradient(135deg, #4ECDC4, #76E5DE);
}

.relay-player-row.player4 {
  background: linear-gradient(135deg, #FF6B6B, #FF9F9F);
}

.relay-player-name {
  font-size: min(3vw, 24px);
  font-weight: bold;
  color: #fff;
}

.relay-player-count {
  font-size: min(4vw, 32px);
  font-weight: bold;
  color: #fff;
  text-align: right;
}

.relay-player-snag {
  font-size: 50%;
  color: #ff4444;
  margin-top: 2px;
  font-weight: bold;
}

body.landscape-mode .player3-container {
  gap: 1vh;
}

body.landscape-mode .player3-total-container {
  padding: 2vh;
  width: 100%;
}

body.landscape-mode .player3-total-number {
  font-size: 8vw;
}

body.landscape-mode .player3-grid {
  display: flex;
  width: 100%;
  gap: min(2vh, 16px);
}

body.landscape-mode .player3-card {
  flex: 1;
  padding: min(2vh, 16px) min(1.5vh, 12px);
}

body.landscape-mode .player3-title {
  font-size: 1.5vw;
  margin-bottom: 2vh;
}

body.landscape-mode .player3-count {
  font-size: 3vw;
  min-height: 60px;
  padding-bottom: 1vh;
}

body.landscape-mode .relay-result-container {
  padding: min(2vh, 16px) min(2vw, 16px);
  gap: min(1vh, 8px);
}

body.landscape-mode .relay-result-header {
  margin-bottom: min(1vh, 8px);
}

body.landscape-mode .relay-result-title {
  font-size: min(3vw, 24px);
}

body.landscape-mode .relay-result-total {
  font-size: min(4vw, 32px);
}

body.landscape-mode .relay-result-players {
  gap: min(0.8vh, 6px);
}

body.landscape-mode .relay-player-row {
  padding: min(0.8vh, 6px) min(1.5vw, 12px);
}

body.landscape-mode .relay-player-name {
  font-size: min(2.2vw, 18px);
}

body.landscape-mode .relay-player-count {
  font-size: min(2.8vw, 22px);
}

.player3-total-display.realtime {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player3-total-display.realtime .player3-total-number {
  font-size: 6vh;
}

body.landscape-mode .player3-total-display.realtime .player3-total-number {
  font-size: 8vw;
}

.player3-title.realtime {
  margin-bottom: 1vh;
}

.player3-count.realtime {
  line-height: 1.1;
  padding-bottom: 0.5vh;
  font-size: 3vw;
}

body.landscape-mode .player3-title.realtime {
  margin-bottom: 1vh;
}

body.landscape-mode .player3-count.realtime {
  line-height: 1.1;
  padding-bottom: 0.5vh;
  font-size: 1.5vw;
}

body:not(.landscape-mode) .player3-title.realtime {
  margin-bottom: min(1vh, 1px);
}

body:not(.landscape-mode) .player3-count.realtime {
  line-height: 1.2;
  padding-bottom: min(1vh, 8px);
}


.ranking-cell {
  padding: 1vh;
  text-align: center;
}

.ranking-cell-date {
  padding: 0.4vh;
  text-align: center;
}

/* 순위 컬럼 스타일 */
.ranking-rank {
  font-weight: bold;
}

.ranking-rank.rank-1 {
  color: #ffcc00;
  font-size: 2.2vw;
}

.ranking-rank.rank-2 {
  color: #c0c0c0;
  font-size: 2.2vw;
}

.ranking-rank.rank-3 {
  color: #cd7f32;
  font-size: 2.2vw;
}

.ranking-rank.rank-other {
  color: white;
  font-size: 2vw;
}

.ranking-total {
  font-weight: bold;
}

.ranking-total.rank-1 {
  color: #ffcc00;
  font-size: 2.2vw;
}

.ranking-total.rank-2 {
  color: #c0c0c0;
  font-size: 2.2vw;
}

.ranking-total.rank-3 {
  color: #cd7f32;
  font-size: 2.2vw;
}

.ranking-total.rank-other {
  color: white;
  font-size: 1.6vw;
  font-weight: normal;
}

.ranking-player {
  font-size: 1.6vw;
}

.ranking-player.rank-1,
.ranking-player.rank-2,
.ranking-player.rank-3 {
  color: inherit;
}

.ranking-player.rank-other {
  color: white;
}

.ranking-date {
  font-weight: normal;
}

.ranking-date.rank-1 {
  color: #ffcc00;
  font-size: 1.1vw;
  font-weight: bold;
}

.ranking-date.rank-2 {
  color: #c0c0c0;
  font-size: 1.1vw;
  font-weight: bold;
}

.ranking-date.rank-3 {
  color: #cd7f32;
  font-size: 1.1vw;
  font-weight: bold;
}

.ranking-date.rank-other {
  color: white;
  font-size: 1vw;
}

body.landscape-mode .ranking-rank.rank-1,
body.landscape-mode .ranking-rank.rank-2,
body.landscape-mode .ranking-rank.rank-3 {
  font-size: 1.1vw;
}

body.landscape-mode .ranking-rank.rank-other {
  font-size: 0.9vw;
}

body.landscape-mode .ranking-total.rank-1,
body.landscape-mode .ranking-total.rank-2,
body.landscape-mode .ranking-total.rank-3 {
  font-size: 1.1vw;
}

body.landscape-mode .ranking-total.rank-other {
  font-size: 0.8vw;
}

body.landscape-mode .ranking-player {
  font-size: 0.8vw;
}

body.landscape-mode .ranking-date.rank-1,
body.landscape-mode .ranking-date.rank-2,
body.landscape-mode .ranking-date.rank-3 {
  font-size: 0.6vw;
}

body.landscape-mode .ranking-date.rank-other {
  font-size: 0.5vw;
}

body.landscape-mode .ranking-cell {
  padding: 0.4vh;
}

body.landscape-mode .ranking-cell-date {
  padding: 0.2vh;
}

.ranking-separator {
  height: 1vh;
  background: transparent;
  border: none;
}

.ranking-separator td {
  padding: 0;
  border: none;
  background: transparent;
}

body.landscape-mode .ranking-separator {
  display: table-row;
}

#reset-ranking-btn:hover {
  background-color: #c82333;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
  transform: scale(1.05);
}

#reset-ranking-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.landscape-mode #reset-ranking-btn {
  width: 6vw;
  height: 3vh;
  min-width: 50px;
  min-height: 24px;
  max-width: 90px;
  max-height: 36px;
  font-size: 1vh;
}