*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  font-size: clamp(12px, 1.5vw, 16px);

  --color-text: #f2f2f2;      

  --color-bg: hsl(97.77deg 8.96% 40.74% / 24%);

  --color-link: #000;
  --color-link-hover: #333;
  --page-padding: 1.5rem;
}

body {
  margin: 0;
  color: #111;
  background: var(--color-bg);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
nav,
.mono,
.code {
  font-family: 'Inter', sans-serif;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
}

p,
li {
  font-size: 1rem;
  font-weight: 400;
}

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

a {
  transition: all 0.2s ease;
}

button {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  background-color: transparent;
  border: 1px solid #333;
  color: #333;
}

button:hover {
  background-color: #333;
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  body {
    background: linear-gradient(-45deg,
        hsl(97.77deg 8.96% 40.74% / 24%),
        hsl(200deg 40% 50% / 30%),
        hsl(340deg 60% 50% / 30%),
        hsl(260deg 40% 60% / 30%));
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
  }

  @keyframes gradientShift {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }
}

@media (max-width: 767px) {
  body {
    background: var(--color-bg);
    animation: none;
  }
}

@media (scripting: enabled) {
  .loading::before,
  .loading::after {
    content: '';
    position: fixed;
    z-index: 10000;
  }

  .loading::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
  }

  .loading::after {
    top: 50%;
    left: 50%;
    width: 100px;
    height: 1px;
    margin: 0 0 0 -50px;
    background: var(--color-link);
  }

  @media (prefers-reduced-motion: no-preference) {
    .loading::after {
      animation: loaderAnim 1.5s ease-in-out infinite alternate forwards;
    }

    @keyframes loaderAnim {
      0% {
        transform: scaleX(0);
        transform-origin: 0% 50%;
      }

      50% {
        transform: scaleX(1);
        transform-origin: 0% 50%;
      }

      50.1% {
        transform: scaleX(1);
        transform-origin: 100% 50%;
      }

      100% {
        transform: scaleX(0);
        transform-origin: 100% 50%;
      }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .loading::after {
      animation: none;
    }
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

a:hover::after {
  transform: scaleX(1);
}

a:focus {
  outline: none;
  background: lightgrey;
}

a:focus:not(:focus-visible) {
  background: transparent;
}

a:focus-visible {
  outline: 2px solid red;
  background: transparent;
}

.frame {
  padding: 3rem var(--page-padding) 0;
  display: grid;
  z-index: 1000;
  position: relative;
  grid-row-gap: 1rem;
  grid-column-gap: 2rem;
  pointer-events: none;
  justify-items: start;
  grid-template-columns: auto;
  grid-template-areas:
    'title'
    'github'
    'tags';
}

.frame a,
.frame button {
  pointer-events: auto;
}

.frame__title {
  grid-area: title;
  font-size: inherit;
  margin: 0;
  color: #333;
}

.frame__social {
  grid-area: github;
  display: flex;
  gap: 1rem;
}

.frame__tags {
  grid-area: tags;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media screen and (min-width: 53em) {
  .frame {
    padding: var(--page-padding);
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
    align-content: space-between;
    grid-template-areas:
      'title github github'
      'tags tags tags';
  }

  .frame__tags {
    align-self: end;
  }
}

.content {
  padding: var(--page-padding);
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

@media screen and (min-width: 53em) {
  .content {
    min-height: 100vh;
    justify-content: center;
    align-items: center;
  }
}

.container {
    position: relative;
    width: 100%;
    height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    background-size: 15px 15px;
    padding: 20px;
}

.instructions {
    margin: 1rem 0;
    font-family: 'Inter', sans-serif;
    text-align: center;
    color: #333;
    position: relative;
    z-index: 1100;
}


/* Shirts Area */
.shirts-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rat-center { /* Styles #centerImage */
    position: absolute;
    max-width: 18%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;

    filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.15));

}

.shirt {
    position: absolute;
    max-width: 9.8%;
    height: auto;
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center center;
    will-change: transform;
    touch-action: none;

    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.08));

}

.shirt:focus {
    outline: none;
}

.shirt:focus-visible {
    outline: 2px solid red;
}

.shirt.grabbed {
    transform: scale(1.05);

    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));

}

.shirt.dragging-right {
    transform: perspective(500px) 
              rotateY(-15deg) 
              rotateX(5deg)
              scale(0.92, 0.98) 
              skew(-5deg, 2deg);

    filter: drop-shadow(2px 2px 5px rgba(0,0,0,0.08));

}

.shirt.dragging-left {
    transform: perspective(500px) 
              rotateY(15deg) 
              rotateX(5deg)
              scale(0.92, 0.98) 
              skew(5deg, -2deg);

    filter: drop-shadow(-2px 2px 5px rgba(0,0,0,0.08));

}

.top-left { top: 20%; left: 15%; }
.middle-right { top: 45%; left: 80%; }
.bottom-left { top: 70%; left: 15%; }
.bottom-right { top: 70%; left: 80%; }
  .top-right { top: 20%; left: 80%; }


/* Tooltip for Model Info */
#info-tooltip {
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 0.25rem;
    color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.92rem;
    font-weight: bold;
    cursor: help;
    z-index: 15;
    transition: border-color 0.2s ease, color 0.2s ease;
    font-family: 'Inter', sans-serif;
}

#info-tooltip:hover {
    color: rgba(0, 0, 0, 0.9); 
    border-color: rgba(0, 0, 0, 0.9); 
}

#info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%; 
    left: 50%;
    transform: translateX(-50%); 
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 20;
}

#info-tooltip:hover::after,
#info-tooltip.tooltip-visible::after {
    opacity: 1;
    visibility: visible;
}


/* --- Responsive Styles --- */
@media (max-width: 767px) {
    .container {
        padding-top: 120px; 
        padding-bottom: 5vh;
    }

    .shirts-container {
        padding: 0;
    }

    .shirt {
        max-width: 21%; 
        transition: transform 0.2s ease-out;
    }

    .top-left { top: 25%; left: 5%; }
    .middle-right { top: 40%; left: 75%; }
    .top-right { top: 25%; left: 75%; }
    .bottom-left { top: 50%; left: 5%; }
    .bottom-right { top: 50%; left: 75%; }

    .rat-center { /* Styles #centerImage */
        max-width: 70%;
        top: 45%;
        left: 50%;
        /* transform: translate(-50%, -50%); is inherited */

        filter: drop-shadow(4px 4px 6px rgba(0,0,0,0.15));

    }


}

@media (max-width: 377px) {
}
@media (min-width: 378px) and (max-width: 429px) {
}

/* Suggestion feature */
#suggestion-container,
.suggestion-container {
    position: absolute;
    top: 22px;
    right: 20px;
    z-index: 1010;
    text-align: right;
    color: #000;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 767px) {
    #suggestion-container {
        position: absolute;
        top: 152px;
        left: 20px;
        z-index: 1010;
        text-align: unset;
        color: #000;
        font-family: 'Inter', sans-serif;
    }

    .suggest-input-container {
        justify-content: flex-start !important;
    }
}

#suggest-link {
    cursor: pointer;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

#shuffle-button {
    cursor: pointer;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    display: block;
    width: fit-content;
    margin: 0 auto 1rem;
    align-items: center;
    position: relative;
    z-index: 1100;
}


#suggest-link .toggle-icon {
    width: 1em;
    height: 1em;
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
    stroke: currentColor;
    fill: none;
}

#suggest-link.open .toggle-icon {
    transform: rotate(180deg);
}

#suggest-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

#suggest-error {
    color: #d00;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    display: none;
    width: 100%;
}

#suggest-error.visible {
    display: block;
}

#suggest-error.animate {
}

@media (prefers-reduced-motion: no-preference) {
    #suggest-error.animate {
        animation: suggest-error-slide 0.3s ease-out;
    }

    @keyframes suggest-error-slide {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    #suggest-error.animate {
        animation: none;
    }
}

#suggest-submit {
    margin-left: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



#suggest-submit svg {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
}

@media (prefers-reduced-motion: no-preference) {
    #suggest-submit svg {
        animation: submit-arrow-slide 1s ease-in-out infinite;
    }

    @keyframes submit-arrow-slide {
        0%, 100% {
            transform: translateX(0);
        }
        50% {
            transform: translateX(3px);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    #suggest-submit svg {
        animation: none;
    }
}

.suggest-input-container {
    margin-top: 0.5rem;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.suggest-input-container.open {
    opacity: 1;
    transform: scaleY(1);
}


.suggest-messages {
    position: fixed;

    top: 10%;

    left: 0;
    right: 0;
    overflow: visible;
    pointer-events: auto;
    z-index: 1010;
    text-align: center;
    cursor: grab;
    min-height: 1rem;
}

.suggest-messages.dragging {
    cursor: grabbing;
}


.suggest-marquee {
    display: inline-flex;
    align-items: flex-end;
    white-space: nowrap;
    position: relative;
    pointer-events: auto;
    touch-action: none;
    animation: suggest-scroll 20s linear forwards;
}

.suggest-marquee:hover {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .suggest-marquee {
        animation: none;
    }
}

.suggest-text {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
}

.suggest-close {
    background: transparent;
    border: none;
    color: #555;
    font-size: 1.5rem;
    margin-right: 0.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    transition: background-color 0.2s ease;
}

.suggest-close:hover,
.suggest-close:focus {
    background-color: rgba(0, 0, 0, 0.1);
    outline: none;
}

@keyframes suggest-scroll {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}


.rat-center.change-effect {
}

@media (prefers-reduced-motion: no-preference) {
    .rat-center.change-effect {
        animation: change-bounce 0.3s ease-out;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rat-center.change-effect {
        animation: none;
    }
}

@keyframes change-bounce {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.suggest-list {
    position: absolute;
    top: 1rem;
    left: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: grab;
    z-index: 1005;
}

.suggest-list.dragging {
    cursor: grabbing;
}

.suggest-list-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
}

.suggest-item {
    margin-bottom: 0.25rem;
    color: #000;
    display: flex;
    align-items: center;
}

.suggest-delete {
    background: transparent;
    border: none;
    color: #555;
    font-size: 1rem;
    margin-right: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.suggest-delete:hover,
.suggest-delete:focus {
    background-color: rgba(0, 0, 0, 0.1);
    outline: none;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  p {
    font-size: 0.95rem;
  }
}

.font-mono {
  font-family: 'Inter', sans-serif;
}

.font-sans {
  font-family: 'Inter', sans-serif;
}

.text-lg {
  font-size: 1.25rem;
}

.text-sm {
  font-size: 0.875rem;
}

