body {
  margin: 0;
  background-color: #111;
  color: #ff00ff;
  font-family: 'Arial', sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 2px solid #ff00ff;
}

.logo img {
  height: 40px;
}

.twitter-login button {
  background-color: #ff00ff;
  color: #111;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.controls {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.controls label {
  margin-right: 8px;
}

.controls select,
.controls button {
  padding: 10px 16px;
  border: 2px solid #ff00ff;
  background-color: transparent;
  color: #ff00ff;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.controls button:hover,
.controls select:hover {
  background-color: #ff00ff;
  color: #111;
  transform: scale(1.05);
}

.layout {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  padding: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

#how-to-play,
#leaderboard {
  width: 200px;
  border: 2px solid #ff00ff;
  padding: 10px;
  font-size: 14px;
  background-color: #1a1a1a;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px #ff00ff;
  text-align: center;
}

#how-to-play h3,
#leaderboard h3 {
  margin-bottom: 8px;
  position: relative;
}

#how-to-play h3::after,
#leaderboard h3::after {
  content: "";
  display: block;
  width: 60%;
  height: 1px;
  background: #ff00ff;
  margin: 6px auto 12px auto;
  opacity: 0.6;
}

#how-to-play {
  height: fit-content;
  min-height: 120px;
}

#leaderboard {
  height: 420px;
}

#game-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 300px;
  max-width: 100%;
  box-shadow: 0 0 10px #ff00ff;
  border-radius: 8px;
  padding: 10px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 200px);
  border: 2px solid #ff00ff;
  background-color: #222;
}


.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  background: rgba(0, 0, 0, 0.9);
  color: #ff00ff;
  font-size: 64px;
  font-weight: bold;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 30, 30, 0.9);
  color: #ff00ff;
  padding: 20px;
  border: 2px solid #ff00ff;
  z-index: 10000;
  display: none;
  flex-direction: row;
  text-align: left;
  gap: 20px;
  border-radius: 12px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}
.top-bar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.difficulty-wrapper,
.play-reset,
.clicks-timer {
  display: flex;
  align-items: center;
  gap: 8px;
}

#hint-btn {
  padding: 10px 16px;
  border: 2px solid #ff00ff;
  background-color: transparent;
  color: #ff00ff;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
}

#hint-btn:hover:enabled {
  background-color: #ff00ff;
  color: #111;
  transform: scale(1.05);
}
.popup-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.popup-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup img {
  max-width: 100%;
  max-height: 300px;
  border: 1px solid #ff00ff;
  border-radius: 6px;
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.popup-buttons button,
.close-btn {
  background: #ff00ff;
  color: #111;
  font-weight: bold;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.popup-buttons button:hover,
.close-btn:hover {
  background-color: #e000e0;
}

#hint-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: #000;
  border: 3px solid #ff00ff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 0 20px #ff00ff;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}

#hint-popup img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

#hint-popup .hint-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}


#hint-close {
  margin-top: 10px;
  background: #ff00ff;
  color: #111;
  font-weight: bold;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    align-items: center;
  }
  .twitter-login {
    display: none !important;
  }

  .play-reset {
    display: flex;
    gap: 10px;
  }

  .clicks-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-weight: bold;
  }

  #clicks, #timer {
    display: inline-block;
    text-align: center;
  }


  .controls {
    flex-direction: column;
    align-items: center;
  }

  .difficulty-wrapper {
    flex-direction: row;
    justify-content: center;
    flex-wrap: nowrap;
  }

  #game-panel {
    width: 100%;
    padding: 10px;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
  }

  #how-to-play,
  #leaderboard {
    width: 90%;
    margin-top: 15px;
  }

  .popup {
    flex-direction: column;
    padding: 15px;
  }

  .popup-right img {
    max-width: 100%;
    height: auto;
  }

  .popup-buttons {
    flex-direction: column;
    align-items: center;
  }

  .top-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .difficulty-wrapper,
  .play-reset,
  .clicks-timer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
  }
}

#result-popup {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
}
.popup-right {
  position: relative;
}
.popup-right .watermark {
  position: absolute;
  top: 2%;
  right: 2%;
  width: clamp(30px, 8%, 60px);
}
body {
  margin: 0;
  background-color: #111;
  color: #ff00ff;
  font-family: 'Arial', sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 2px solid #ff00ff;
}
.logo img { height: 40px; }
.twitter-login button {
  background-color: #ff00ff;
  color: #111;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}
.controls {
  text-align: center;
  margin-bottom: 10px;
}
.controls label {
  margin-right: 8px;
}
.controls select, .controls button {
  margin: 0 5px;
  padding: 10px 16px;
  border: 2px solid #ff00ff;
  background-color: transparent;
  color: #ff00ff;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
}
.controls button:hover, .controls select:hover {
  background-color: #ff00ff;
  color: #111;
  transform: scale(1.05);
}
.layout {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  padding: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}
#how-to-play, #leaderboard {
  width: 200px;
  border: 2px solid #ff00ff;
  padding: 10px;
  font-size: 14px;
  background-color: #1a1a1a;
  overflow-y: auto;
}
#how-to-play {
  height: fit-content;
  min-height: 120px;
}
#leaderboard {
  height: 420px;
}
#game-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 300px;
  max-width: 100%;
}
#timer {
  font-weight: bold;
  color: #ff00ff;
  margin-left: 10px;
}
#hint-btn {
  margin-top: 10px;
  background-color: transparent;
  border: 2px solid #ff00ff;
  color: #ff00ff;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#hint-btn:hover:enabled {
  background-color: #ff00ff;
  color: #111;
  transform: scale(1.05);
}
#hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
canvas {
  border: 2px solid #ff00ff;
  background-color: #222;
  max-width: 100%;
  height: auto;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  background: rgba(0, 0, 0, 0.9);
  color: #ff00ff;
  font-size: 64px;
  font-weight: bold;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #000000;
  color: #ff00ff;
  padding: 20px;
  border: 5px solid #ff00ff;
  z-index: 10000;
  display: none;
  flex-direction: row;
  justify-content: space-between;
  gap: 30px;
  max-width: 700px;
  width: 90%;
  border-radius: 10px;
}
.popup-left {
  flex: 1;
  text-align: center;
  font-size: 18px;
  line-height: 1.6;
}

.popup-left h2 {
  font-size: 24px;
  margin-bottom: 15px;
}

.popup-left p {
  font-size: 18px;
  margin: 10px 0;
}

.popup-left a {
color: #00ffff;
font-weight: bold;
text-decoration: underline;
}
.popup-right {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
max-width: 50%; 
}

.popup img {
width: 100%;
height: auto;
max-height: none; 
}
.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.popup-buttons button {
  background: #ff00ff;
  color: #111;
  font-weight: bold;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-buttons button:hover {
  transform: scale(1.05);
  background-color: #ff33cc;
}
.close-btn {
  margin-top: 10px;
  background: #ff00ff;
  color: #111;
  font-weight: bold;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}