* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f7f7f7;
  min-height: 100vh;
  padding: 25px;
  /*overflow: hidden;  Prevent scrolling */
  /*touch-action: none; /* Disable touch scrolling */
  -webkit-overflow-scrolling: none; /* Disable iOS momentum scrolling */
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  /* overflow: hidden; Prevent container scrolling */
}

.playable-spot-ring {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(90vw, 700px);
  height: min(90vw, 650px);
  margin-bottom: 0px;
  margin-top: 0px;
}

.playable-spot, .non-playable-spot {
  position: absolute;
  width: min(18vw, 130px);
  height: min(13vw, 85px);
  background-color: rgb(201, 201, 201);
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(8px, 1.8vw, 14px);
  text-align: center;
}

.non-playable-spot {
  background-color: rgb(177, 177, 177);
  width: min(15vw, 120px);
  height: min(10vw, 75px);
  font-weight: bold;
  /*border: 2px solid rgb(177, 177, 177, 0);*/
  font-weight: bold;
  text-transform: uppercase;
}

.playable-spot-backing
{
  position: absolute;
  /*width: min(18vw, 130px);
  height: min(14vw, 85px);*/
  background-color: #f7f7f7;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(8px, 1.8vw, 14px);
  text-align: center;
}

.tiles-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  /*width: 100%;*/
  max-width: min(85vh, 85vw);
  /*padding: 10px;*/
  justify-items: center;
  align-items: center;
}

.tiles-container-five {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-width: min(85vh, 85vw);
  justify-items: center;
  align-items: center;
  flex-wrap: wrap;
}

.tile-five{
  grid-column: span 2;
}

.tile-five:nth-child(4) {
  grid-column: 2 / span 2;
}

.tile {
  width: min(18vw, 130px);
  height: min(13vw, 85px);
  background-color: rgb(216, 216, 216);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: clamp(8px, 1.8vw, 14px);
  padding: 5px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase; /* This ensures text stays uppercase even if changed */
}

button {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: clamp(14px, 2.5vw, 16px);
}

.attempts-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 25px;
}

.attempt {
  width: min(3vw, 10px);
  height: min(3vw, 10px);
  background-color: black;
  border-radius: 50%;
}

.mistakes-text {
  font-size: 16px;
  margin-right: 4px;
}

.hidden {
  display: none;
  z-index: -2;
}

#hiddenWordsContainer {
  display: flex;
  justify-content: space-evenly;
  gap: 10px;
  margin-top: 20px;
}

.hidden-word {
  font-size: 12px;
  font-weight: bold;
  color: rgb(0, 0, 0);
  display: none; /* Hide by default */
}

.center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  font-size: clamp(12px, 3vw, 24px);
  text-align: center;
  background-color: #f7f7f7;
}

.center-text-mobile {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -40%);
  font-size: clamp(12px, 3vw, 24px);
  text-align: center;
  background-color: #f7f7f7;
}

.center-text-button {
  font-size: clamp(14px, 3vw, 18px);
  padding: 8px 16px;
}

.hint-container {
  padding: 20px;
}

.category-hint {
  width: min(25vw, 100px);
  height: min(10vw, 60px);
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  font-size: clamp(8px, 1.8vw, 12px); /* Smaller font size */
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.buttons-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 5px;
}

.tile-hints-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0 10px;
  margin: 5px 0;
}

.hint-tile {
  width: min(25vw, 100px);
  height: min(8vw, 60px);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  font-size: clamp(8px, 1.8vw, 12px); /* Smaller font size */
  padding: 5px 8px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.home-spot {
  width: min(18vw, 130px);
  height: min(13vw, 85px);
  background-color: rgb(201, 201, 201);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: clamp(8px, 1.8vw, 14px);
  text-align: center;
  font-weight: bold;
  text-transform: uppercase; /* This ensures text stays uppercase even if changed */
}

.navbar {
  background-color: #c4e385;
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.nav-title {
  font-weight: bold;
  font-size: 18px;
}

.nav-date {
  font-size: 16px;
}

.nav-right {
  display: flex;
  gap: 20px;
}

.nav-right a {
  color: black;
  font-size: 20px;
  text-decoration: none;
}

.nav-right a:hover {
  opacity: 0.7;
}

.social-icons {
  position: fixed;
  bottom: 50px;
  right: 50px;
  display: flex;
  gap: 25px;
  z-index: 1000;
}

.social-icons a {
  color: black;
  font-size: 24px;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.social-icons a:hover {
  opacity: 0.7;
}

.virtual-keyboard {
  display: none;
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  padding: 10px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin: 5px 0;
  gap: 3px;
}

.key {
  background-color: #e6e6e6;
  border: none;
  border-radius: 4px;
  color: #000;
  padding: 12px;
  min-width: 30px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 43px;
  height: 43px;
}

.keyDesktop{
  background-color: #e6e6e6;
  border: none;
  border-radius: 4px;
  color: #000;
  min-width: 30px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.key:active {
  background-color: #cccccc;
}

.key.wide {
  width: 80px;
}

@media (max-width: 600px) {
  .playable-spot-ring {
    margin-top: 50px;
  }
  
  button {
    padding: 8px 16px;
  }

  .playable-spot, .non-playable-spot {
    font-size: clamp(7px, 1.5vw, 12px);
  }

.non-playable-spot {
    margin-left: 3%;
    margin-top: 1%;
  }

  .tile {
    font-size: clamp(9px, 1.5vw, 12px);
  }

  .buttons-container {
    gap: 8px;
  }

  .social-icons {
    bottom: 25px;
    right: 25px;
    gap: 20px;
  }
  
  .social-icons a {
    font-size: 20px;
  }
}

@keyframes jiggle {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.jiggle {
  animation: jiggle 0.5s ease-in-out;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

.fade-message {
  animation: fadeOut 2s forwards;
}

@keyframes confetti {
  0% { transform: translateY(0) rotateZ(0); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateY(100vh) rotateZ(720deg); opacity: 0; }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: var(--color);
  position: absolute;
  top: -10px;
  z-index: 999;
  animation: confetti 3s ease-in-out forwards;
}

.submit-button {
  background-color: transparent;
  border: 2px solid black;
  border-radius: 25px;
  color: black;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button.active {
  background-color: black;
  color: white;
  border: 2px solid black;
}

.submit-button.inactive {
  border: 2px solid rgb(97, 97, 97);
  border-radius: 25px;
  color: rgb(97, 97, 97);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button.active:hover {
  background-color: #333;
  border-color: #333;
}

#answer {
  width: 80%;
  padding: 8px 15px;
  margin: 10px 0;
  border-bottom: 2px solid black;
  font-size: clamp(12px, 3vw, 24px);
  background-color: rgb(216, 216, 216, 0);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  outline: none;
  border-right: 0;
  font-weight: bold;
}

.connection-line {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  animation: flowLine 1s ease-in-out forwards;
  pointer-events: none;
}

@keyframes flowLine {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.connection-pipe {
  position: absolute;
  height: 14px;
  transform-origin: left center;
  pointer-events: none;
  z-index: -1;
}

.video-container {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 720px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    /* Card / glass style */
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16,24,40,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    z-index: 1001;
    margin-bottom: 25px;
}

.video-container h3 {
    color: #0b1220;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.video-frame {
    width: 90%;
    aspect-ratio: 16 / 9;
    border: none; /* remove hard border */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(16,24,40,0.08);
    background-color: rgba(0,0,0,0.02);
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
    .video-container {
        width: 95%;
        max-width: none;
        padding: 12px;
        border-radius: 14px;
    }
}

#doughnut {
    position: relative;
    z-index: -1;
    pointer-events: none;
}

.playable-spot-ring {
    position: relative;
    z-index: 0;
}

.rotation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.rotation-message {
    font-size: 1.2rem;
    text-align: center;
    padding: 20px;
}

.phone-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: rotatePhone 1.5s ease-in-out infinite;
}

@keyframes rotatePhone {
    0% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

@media screen and (orientation: landscape) and (max-width: 900px) {
    body {
        position: fixed;
        width: 100%;
    }
    
    .game-container {
        display: none;
    }
    
    .rotation-overlay {
        display: flex;
    }
}

.connecting-arc {
    pointer-events: none;
    position: absolute;
    overflow: visible;
}

.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-notification.show {
    opacity: 1;
}