body {
        background-image: url('img/beer_otter.jpeg');
        background-size: cover;
        background-attachment: fixed;
        background-position: 30% center;
        background-repeat: no-repeat;
        padding: 20px;
        padding-top: 80px; /* Prevent overlap with top bar */;
        padding-bottom: 80px;
        font-family: 'Lilita One', sans-serif;
    }

@media (min-width: 1200px) {
  body {
    background-position: top center; /* Show whole image normally on wide screens */
  }
}

    .view {
  display: none;
}

#roomView {
  max-width: 500px;
  margin: auto;
}

#appView {
  width: 100%;
}


    .visible {
    display: block;
    }

    #roomView {
    visibility: hidden;
    }

    #logoImage {
    max-width: 65vw;
    max-height: 30vh;
    display: block;
    margin: 0 auto;
    }

    #errorContainer {
    background-color: #dc3545; /* Bootstrap red */
    color: white;
    font-weight: normal;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    animation: fadeOut 4s ease-in forwards;
    }

    @keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; display: none; }
    }

    #userDropdown {
      max-width: 50vw;
      transition: width 0.3s ease;
    }

    #userDropdown:focus {
      max-width: 80vw;
      width: 80vw; /* Expand when opened */
    }

    .w-fixed {
      min-width: 95px;  /* ensures enough space for + 999 */
      text-align: center;
    }

    #topBar,
    #bottomBar {
      background-color: rgba(255, 165, 0, 0.9); /* #ffa500 with slight transparency */
      color: white;
      backdrop-filter: blur(6px); /* Adds the slight blur effect */
      -webkit-backdrop-filter: blur(6px); /* Safari support */
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      z-index: 9999;
    }

    /* Optional: for better contrast inside the bar */
    #topBar select,
    #topBar button,
    #bottomBar button {
      background-color: white;
      color: #ffa500;
      border: none;
      font-weight: normal;
      height: 40px;
      cursor:pointer;
      padding: 5px 20px 5px 20px;
      box-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    }

    #leaveRoomBtn,
    #scoreboardBtn{
      transition: background-color 0.3s ease, color 0.3s ease;
      font-weight:normal;
    }

    #leaveRoomBtn:hover {
      background-color: #dc3545;
      color: white;
    }
    
    #scoreboardBtn:hover {
      background-color: #ff6509;
      color: white;
    }

    #topBar select:focus,
    #topBar button:focus,
    #bottomBar button:focus {
      outline: none;
      box-shadow: 0 0 0 2px rgba(255,165,0,0.3);
    }

    .accordion-button,
    .accordion-button:not(.collapsed) {
      background-color: white !important;
      color: #ffa500 !important;
      font-weight: normal;
      border: none;
      box-shadow: none;
      font-size: large;
    }

    .accordion-button:focus {
      box-shadow: 0 0 0 0.2rem rgba(255, 136, 0, 0.692);
    }

    .accordion-button::after {
      filter: brightness(0) saturate(100%) invert(54%) sepia(83%) saturate(535%) hue-rotate(0deg) brightness(101%) contrast(105%);
    }

    .accordion-button:not(.collapsed)::after {
      transform: rotate(180deg);
    }

    #missionsContainer,
    #completedContainer,
    #continuousContainer
     {
      background-color: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      border-radius: 0.375rem;
      padding: 0.5rem;
      backface-visibility: hidden;
    }

    #totalScore {
  background-color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Lilita One', sans-serif;
  min-width: 130px;
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

#totalScore .label {
  color: #333;         /* dark gray for label */
  font-weight: normal;
}

#totalScore .value {
  color: #ffa500;      /* orange for score */
  font-weight: normal;
}

.one-time-mission {
  position: relative;
  overflow: hidden;
  border: 2px solid #ffcc33;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgb(255, 188, 20), rgba(119, 67, 11, 0.74), rgba(255, 205, 113, 0.9));
  color: white;
  box-shadow: 0 0 20px rgba(255, 204, 51, 0.4), 0 0 40px rgba(255, 204, 51, 0.2);
  z-index: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7), 0 0 5px rgba(255,204,51,0.3);
}

.one-time-mission::before {
  content: '';
  position: absolute;
  top: 0;
  right: -150%;
  width: 250%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 240, 170, 0.12) 20%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 240, 170, 0.12) 60%,
    rgba(255, 255, 255, 0) 80%
  );
  animation: goldenShimmerReverse 6s linear infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes goldenShimmerReverse {
  0% {
    right: -150%;
  }
  100% {
    right: 100%;
  }
}

#continuousContainer,
#missionsContainer,
#completedContainer {
  background-image: url('img/container_background.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fd7200; /* fallback color */
  border-radius: 0 0 0.375rem 0.375rem; /* remove top, keep bottom radius */
  padding: 1rem;
}

#topBar, #bottomBar {
  background-image: url('img/bar_background.svg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#bottomBar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  /*will-change: transform; /* Helps on mobile render engines */*/
}

.modal-content {
  background-image: url('img/modal_background.svg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.scoreboard-background {
  background-image: url('img/scoreboard_background.svg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.rank-achieved {
  background-image: url('img/rank_notification.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.modal-header{
  border-bottom: 0;
}

.modal-footer{
  border-top: 0;
}

.mission-increment-btn {
  background-color: #61d170; /* Bootstrap green */
  color: white;
  border: 1px solid #61d170;
  border-radius: 0.5rem;
  font-weight:bold;
  text-shadow:1px 1px 2px rgba(0,0,0,0.6);
  font-size: medium;
  width: 50px;
}

.mission-increment-btn:hover {
  background-color: #61d170; /* Bootstrap green */
  color: white;
  border: 1px solid #61d170;
}

.accordion-layout {
  padding-left: 0;
  padding-right: 0;
}


@media (min-width: 992px) {
  .accordion .accordion-button {
    font-size: 1.1rem;
  }
}

.score-badge {
  display: inline-block;
  min-width: 60px;
  margin-left: 5px;
  text-align: center;
  margin-left: 10px;
  border-radius: 0.5rem;
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* Green scale from 75 to 150 */
.score-75  { background-color: #61d170; }  /* lightest green */
.score-80  { background-color: #61d170; }
.score-85  { background-color: #61d170; }
.score-90  { background-color: #3cbd4d; }
.score-95  { background-color: #3cbd4d; }
.score-100 { background-color: #3cbd4d; }
.score-105 { background-color: #25aa37; }
.score-110 { background-color: #25aa37; }
.score-115 { background-color: #25aa37; }
.score-120 { background-color: #159626; }
.score-125 { background-color: #159626; }
.score-130 { background-color: #159626; }
.score-135 { background-color: #0a7018; }
.score-140 { background-color: #0a7018; }
.score-145 { background-color: #0a7018; }
.score-150 { background-color: #0a7018; }  /* darkest green */

.scoreboard-title{
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  color:#fff;
  text-transform: uppercase;
}

.accordion-item {
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* subtle drop shadow */
  border-radius: 0.375rem; /* keep rounded corners if desired */
  margin-bottom: 1rem; /* optional spacing between items */
}

#userWarning {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

#userWarning.show {
  opacity: 1;
  visibility: visible;
}

#userExistsNotice {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

#userExistsNotice.show {
  opacity: 1;
  visibility: visible;
}

#successNotification {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  width: 500px;
  margin: 0 auto;
}
#successNotification.show {
  visibility: visible;
  opacity: 1;
}

.mission-card {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-move-out {
  opacity: 0;
  transform: translateX(30px);
}

.fade-move-in {
  opacity: 0;
  transform: translateX(-30px);
  animation: fadeSlideIn 0.6s forwards;
}

@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.center-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-in-out;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  font-weight: normal;
}
.center-toast.show {
  opacity: 1;
}

/* Add padding inside the dropdown menu */
.dropdown-menu {
  padding: 0.75rem 0; /* Top/bottom padding */
}

/* Style individual list items */
.dropdown-menu li {
  padding: 0.5rem 1rem;
  cursor: pointer; /* ✅ Show pointer */
  transition: background-color 0.2s ease;
}

.dropdown-menu li:hover {
  background-color: #f8f9fa;
}

/* Style the "+ Uusi käyttäjä" option */
.dropdown-menu .dropdown-new-user {
  font-weight: bold;
  color: #007bff;
  border-top: 1px solid #ddd;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

#userExistsNotice,
#userWarning,
#successNotification {
  max-width: 500px;
  width: 90%;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
}

.mission-card {
  min-height: 50px;
  display: flex;
  justify-content: space-between;
}

.mission-normal-body {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  min-height: 50px;
}

.mission-name-container {
  flex: 6;
  height: 100%;
  padding-left: 0.25rem;
  display: flex;
  align-items: center;
}

.mission-score-container {
  flex: 2;
  padding-right: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.card{
    border: 0px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}

.card-body {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: right center;
  border-radius: 0.375rem;
}

.dark-bg-text {
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  font-weight:normal;
}

.scoreboard-wrapper {
  border-radius: calc(0.5rem - 1px);
  overflow: hidden;
}
.rank-img {
  width: 100px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 1s cubic-bezier(0.25, 1.5, 0.5, 1), opacity 1s ease;
  z-index: 1;
}

.rank-img.start-position {
  transform: translate(-50%, -150%);
  opacity: 0;
}

.rank-img.animate-in {
  transform: translate(-50%, -50%);
  opacity: 1;
  z-index: 2;
}

.rank-img.animate-out {
  transform: translate(-50%, 100%);
  opacity: 0;
  z-index: 1;
}

td {
    vertical-align: middle;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  aspect-ratio: 1 / 1; /* Make entire grid a square */
  max-width: 90vmin;
  margin: 0 auto;
}

.bingo-cell {
  background-color: #f9f9f9;
  border: 2px dashed #ff6c0054;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1; /* Make each cell a square */
  text-align: center;
  padding: 6px;
  word-wrap: break-word;
  line-height: 1.1;
  font-size: 2.5vmin; /* Responsive font size */
  box-shadow: 0 0 2px rgba(0,0,0,0.1);
  cursor:pointer;
  position:relative;
  overflow:hidden;
}

@media (max-width: 600px) {
  .bingo-cell {
    font-size: 3vmin;
  }
}

.bingo-cell:hover {
  cursor: pointer;
}

.bingo-stamp {
  color: #f009;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  translate: -50% -50%;
  pointer-events: none;
  opacity: 0.85;
  max-width: 90%;
  max-height: 90%;
  line-height: 1;
}


.bingo-cell-complete {
  background-color: #2e7d32;
  color: #fff;
  border: 2px dashed #fff;
}

.bingo-title {
  text-transform: uppercase;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  color:#fff;
}

.bingo-modal-content {
  background-image: url('img/scoreboard_background.svg');
  background-size: cover;
  background-position: center;
  border-radius: 0.5rem;
}

/* Make sure modals are layered correctly */
#bingoModal {
  z-index: 1050;
}

#markCompleteModal {
  z-index: 1060;
}

.modal-backdrop {
  z-index: 1049 !important; /* Keep backdrop below both modals */
}

/* Optional: ensure bingo grid remains interactive */
#bingoModal .modal-content {
  position: relative;
  z-index: 1;
}

#bingoCardContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.bottom-bar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: center;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1030;
  background-color: transparent;
}

#filterIconContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

#bingoIconContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 auto;
}

#bingoCompleteCheck {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color:#19875466;
  font-weight:bold;
  z-index: 2;
  pointer-events: none; /* ← important: allows clicks to go through */
}

#filterActiveDot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(5px, -22px);
  font-size: 20px;
  color:#ff2f2f;
  font-weight:bold;
  z-index: 2;
  pointer-events: none; /* ← important: allows clicks to go through */
}

.bingo-footer-text{
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

#noCompletedMissions,
#noOpenMissions{
    color:#fff;
    text-align:center;
    margin-top:15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.btn-primary {
    background-color:#ff6509;
    border: 1px solid #ff6509;
}

.btn-primary:hover {
    background-color:#fff;
    border: 1px solid #ff6509;
    color:#ff6509;
}

.modal.modal-top-adjusted .modal-dialog {
  margin: 0;
  display: flex;
  align-items: center;
  height: 100dvh;
}

.modal.modal-top-adjusted .modal-content {
  margin: auto;
  pointer-events: all;
  max-height: 90dvh;
  overflow-y: auto;
  width: 100%;
}