.rules-popup {
  display: none;
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  background: #f8f4ef;
  border: 1.5px solid #5b4a37;
  padding: 20px 30px 25px 30px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(91, 74, 55, 0.4);
  font-family: "Georgia", serif;
  font-size: 1rem;
  color: #5b4a37;
  line-height: 1.5;
  border-radius: 6px;
  text-align: left;
  z-index: 1000;
  cursor: url('cursor0.PNG') 2 2, auto;
  box-sizing: border-box;
  background-image: url("assets/concrete-wall.png");
  scrollbar-width: auto;
  scrollbar-color: #5b4a37 transparent;
}

.rules-popup::-webkit-scrollbar {
  width: 8px;
}

.rules-popup::-webkit-scrollbar-track {
  background: transparent;
}

.rules-popup::-webkit-scrollbar-thumb {
  background-color: #5b4a37;
}

.rules-popup::-webkit-scrollbar-thumb:hover {
  background-color: #8b6e4a;
}


.rules-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  font-weight: bold;
  color: #5b4a37;
  cursor: url('cursor.PNG') 2 2, auto;
  font-family: "Georgia", serif;
  line-height: 1;
  padding: 4px 8px;
  user-select: none;
  transition: color 0.3s ease;
}

.rules-close:hover {
  color: #d3a984;
}



#cat-signature {
  font-family: 'Rock Salt', cursive;
  font-size: 1.5em;
  color: #333;
}

body {
  background: #fdf6e3;
  background-image: url("assets/concrete-wall.png");
  color: #4b3b2a;
  font-family: 'Playfair Display', serif;
  text-align: center;
  margin: 0;
  padding: 0 20px;
  min-width: 390px;
  overflow-x: hidden;
  cursor: url('cursor0.PNG') 2 2, auto;
}

html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  cursor: url('cursor0.PNG') 2 2, auto;
}


#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}



body.clicked,
html.clicked {
  cursor: url('cursor.PNG') 2 2, auto;
}

h1 {
  font-family: 'Special Elite', cursive;
  font-size: 2.5em;
  margin-bottom: 20px;
}

#cat-id-wrapper {
  display: flex;
  gap: 20px;
  max-width: 700px;
  min-height: 310px;
  margin: 0 auto 20px;
  align-items: center;
  justify-content: center;
  border: 3px solid #decbb7;
  border-radius: 15px;
  background-color: #f7f1ea;
  background-image: url("assets/natural-paper.png");
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  position: relative;
}

#cat-container {
  flex: 0 0 300px;
  width: 300px;
  aspect-ratio: 1 / 1;
  position: relative;
  border: 2px solid #847768;
  /*border-image: url('assets/fuzzy-frame.png') 30 round;*/
  border-radius: 5px;
  box-sizing: border-box;
  overflow: hidden;
}


.cat-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
  object-fit: contain;
}

.cat-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scale(1);
  transform-origin: center;
  pointer-events: none;
  z-index: 10;
}


#layer0 {
  z-index: 100;
}

#layer11 {
  z-index: 95;
  opacity: 0.09;
}

#layer10 {
  z-index: 80;
}
#layer9 {
  z-index: 5;
}
#layer8 {
  z-index: 80;
}
#layer7 {
  z-index: 10;
}
#layer6 {
  z-index: 90;
}
#layer5 {
  z-index: 90;
}
#layer4 {
  z-index: 1;
}
#layer3 {
  z-index: 40;
}
#layer2 {
  z-index: 20;
}
#layer1 {
  z-index: 1;
}


#cat-id-card {
  flex: 1;
  height: auto;
  text-align: left;
  font-family: 'Playfair Display', serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

#cat-id-card h2 {
  font-family: 'Special Elite', cursive;
  font-size: 1.8em;
  margin-bottom: 15px;
  color: #4b3b2a;
  border-bottom: 2px solid #decbb7;
  padding-bottom: 5px;
  user-select: none;
}

#traits-list {
  list-style: none;
  padding-left: 5px;
  padding-right: 10px;
  font-size: 1em;
  color: #5a4c3a;
  margin: 0;
  flex-grow: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-height: none;
}

#traits-list li {
  margin-bottom: 0;
  padding-left: 15px;
  position: relative;
  line-height: 1.2em;
  flex-shrink: 0;
}

#traits-list li::before {
  content: "•";
  color: #decbb7;
  position: absolute;
  left: 0;
  font-size: 1.3em;
  line-height: 1;
  top: 2px;
  user-select: none;
}


#credit-bar {
  font-size: 0.7em;
  color: #87725e;
  border-top: 1px solid #decbb7;
  padding-top: 6px;
  margin-top: 5px;
  padding: 10px;
  text-align: center;
  /*font-style: italic;*/
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 0;
}

.slider-grid {
  cursor: url('cursor0.PNG') 2 2, auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 60px;
  max-width: 700px;
  margin: 0 auto 20px;


}

.slider-container {
  cursor: url('cursor0.PNG') 2 2, auto;
  margin-bottom: 25px;
  font-size: 1.1em;
}

label {
  display: block;
  margin-bottom: 5px;
  font-family: 'Special Elite', cursive;
  cursor: url('cursor0.PNG') 2 2, auto;
}

input[type="range"] {
  width: 100%;
  height: 40px;
  background: transparent;
  appearance: none;
  position: relative;
  cursor: url('cursor0.PNG') 2 2, auto;

}

input[type=range]:disabled {
  opacity: 1 !important;
  pointer-events: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  background: url('assets/slider-track.png') center center no-repeat;
  background-size: 100% 100%;
  border: none;
  cursor: url('cursor0.PNG') 2 2, auto;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  margin-top: -10px;
  background: url('assets/slider-thumb.png') center center no-repeat;
  background-size: contain;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: url('cursor.PNG') 2 2, auto;
}


input[type="range"]::-moz-range-track {
  height: 14px;
  background: url('assets/slider-track.png') center center no-repeat;
  background-size: 100% 100%;
  border: none;
  cursor: url('cursor0.PNG') 2 2, auto;
}

input[type="range"]::-moz-range-thumb {
  width: 40px;
  height: 40px;
  background: url('assets/slider-thumb.png') center center no-repeat;
  /*background-size: contain;*/
  border: none;
  cursor: url('cursor.PNG') 2 2, auto;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-thumb:active {
  box-shadow: none;
}

.note {
  font-size: 0.9em;
  color: #87725e;
  margin-top: 10px;
  font-style: italic;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  user-select: none;

}

#save-btn,
#see-result-btn,
#reset-btn {
  display: inline-block;
  margin: 0 auto 5px;
  padding: 12px 30px;
  background: #decbb7;
  border: none;
  border-radius: 25px;
  font-family: 'Special Elite', cursive;
  font-size: 1.1em;
  color: #4b3b2a;
  cursor: url('cursor.PNG') 2 2, auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
  user-select: none;
}

#save-btn:hover,
#see-result-btn:hover,
#reset-btn:hover {
  background: #c7b29d;
}

@media (max-width: 780px) {
  .slider-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #app {
    padding: 15px;
  }

  #cat-id-wrapper {
    flex-direction: column;
    max-width: 450px;
    height: auto;
    padding-bottom: 10px;
  }

  #cat-container {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  #cat-id-card {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-top: 15px;
  }

  #traits-list {
    max-height: none;
    justify-content: normal;
  }
}

footer {
  text-align: center;
}

footer p {
  font-size: 12px;
}

a {
  color: #767168;
  cursor: url('cursor0.PNG') 2 2, auto;

}

a:hover {
  color: #a39d91;
  cursor: url('cursor.PNG') 2 2, auto;
}

#signature-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Special Elite', cursive;
  margin-top: 10px;
  gap: 10px;
}

#qr-code {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}


#name-input-wrapper {
  max-width: 360px;
  margin: 20px auto;
  text-align: center;
  font-family: 'Special Elite', cursive;
  font-size: 1em;
}

#custom-bracket {
  background: url('assets/bracket.png') no-repeat center;
  background-size: 100% 200%;
  padding: 15px;
  position: relative;
}

#name-input {
  width: 100%;
  font-size: 1.1em;
  font-family: 'Playfair Display', serif;
  border: none;
  background: transparent;
  outline: none;
  text-align: center;
}

#name-label {
  font-size: 0.5em;
}



.acknowledgments {
  font-size: 0.75rem;
  font-family: Georgia, serif;
  color: #5b4a37;
  max-width: 500px;
  line-height: 1.4;
}

.acknowledgments ul {
  padding-left: 20px;
}

.thanks {
  color: #5b4a37;
  cursor: url('cursor.PNG') 2 2, auto;
  text-decoration: underline;
}

.thanks:hover {
  color: #8b6e4a;
}

.rules {
  font-size: 0.95rem;
  font-family: Georgia, serif;
  color: #5b4a37;
  max-width: 500px;
  line-height: 1.4;
}




.top-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'Special Elite', cursive;
  }

  .about-btn {
    cursor: url('cursor.PNG') 2 2, auto;
    line-height: 1;
  }

  .lang-dropdown {
    position: relative;
    cursor: url('cursor.PNG') 2 2, auto;
    line-height: 1;
  }

  .lang-toggle {
    font-family: 'Special Elite', cursive;
  }

  .lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #333;
    border-radius: 6px;
    display: none;
    flex-direction: column;
    min-width: 140px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    font-family: 'Special Elite', cursive;
    font-size: 14px;
  }

  .lang-menu a {
    padding: 8px 12px;
    text-decoration: none;
    color: #222;
  }

  .lang-menu a:hover {
    background: #f2f2f2;
  }