@font-face {
  font-family: "Hachi Maru Pop";
  src: url("./fonts/HachiMaruPop-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("./fonts/Caveat-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.5);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.8);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(120,120,120,0.5) transparent;
}

body {
    background: #ffd4d4;
    font-family: "Hachi Maru Pop", "Roboto", "Arial";
    color: #333;
    margin: 0;
    height: 100%;
}

main {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.container {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

h1, h2 {
    text-align: center;
}

h1 {
    margin: 15px 0 30px;
    font-size: 30px;
}

h2 {
    margin-top: 0;
}

* {
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

header img {
    width: 40px;
    height: auto;
    flex-shrink: 0;
}

.description {
    font-size: 18px;
    margin-bottom: 20px;
}

.description p {
    margin: 10px 0;
}

.description img {
    width: 40px;
}

.game-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 15px;
    min-height: 0;
    flex: 1;
}

.clip {
    background: #2a2a2a;
    border-radius: 12px;
    max-height: 150px;
    width: 100%;
    overflow: hidden;
    border: 3px solid #444;
    transition: border-color 0.3s;
}

.clip:hover {
    border-color: #ffd4d4;
}

.clip img {
    width: 100%;
    display: block;
}

.photos-container {
    padding: 30px 35px 30px 15px;
    overflow-y: auto;
    min-height: 0;
    height: 100%;
    background: #ffb9c8;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    direction: rtl;
    overflow-x: hidden;
}

.photos-container__body {
    direction: ltr;
}

.photos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.photo {
    padding: 12px 12px 10px;
    background: white;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    text-align: center;
    font-family: sans-serif;
    transform: rotate(-3deg);
    position: relative;
    cursor: grab;
    user-select: none;
}

.photo:nth-child(2n) {
    transform: rotate(4deg);
}

.photo:nth-child(3n) {
    transform: rotate(-7deg);
}

.photo:nth-child(4n) {
    transform: rotate(1deg);
}

.photo-content {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    overflow: hidden;
}

.photo-description {
    color: #000;
    font-size: 20px;
    margin-top: 5px;
    font-family: "Caveat", "Hachi Maru Pop", "Roboto", "Arial";
    line-height: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2em;
}

.album .photo-description {
    font-size: 16px;
}

.photo .clip {
    height: 100%;
    width: 100%;
    border: none;
    border-radius: 0;
    max-height: unset;
}

.photo .clip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo:hover {
    transform: rotate(0deg) scale(1.05);
    transition: 0.3s;
}

/* .slots {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
} */

.slots-group {
    margin-bottom: 20px;
    border-bottom: 1px dashed #fff;
    padding-bottom: 20px;
}

.slots-group__title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 10px;
}
.slots-group__items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
}

.slot-content {
    overflow: hidden;
    border: 1px dashed #fff;
    border-radius: 5px;
    aspect-ratio: 6 / 7.3;
}

.slot-number {
    font-size: 14px;    
    margin-bottom: 10px;
    text-align: center;
}

.slot-body {
    position: relative;
}

.slot .photo {
    transform: rotate(0);
    box-shadow: none;
    height: 100%;
}

.check-btn {
    display: none;
    margin: 15px auto;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    font-family: "Hachi Maru Pop", "Roboto", "Arial";
    border: 2px solid #333;
    background: none;
    transition: 0.3s;
}

.album {
    background: #eab8e3;
    padding: 20px 0 30px 30px;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.album__body {
    overflow-y: auto;
    padding-right: 15px;
}

/* .check-btn:hover {
    border-color: #ffd4d4;
    color: #ffd4d4;
} */
  
.result-field {
    margin-bottom: 30px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.slot.correct .slot-body::after {
    content: '';
    background: #fff url('../resources/img/success.svg') no-repeat center center / 25px auto;
    position: absolute;
    top: -15px;
    right: -10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
}

.slot.wrong .slot-body::after {
    content: '';
    background: #fff url('../resources/img/error.svg') no-repeat center center / 20px auto;
    position: absolute;
    top: -15px;
    right: -10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
}

body.game-over .photos-container {
    display: none;
}

body.game-over .game-field {
    grid-template-columns: 100%;
    margin: 30px 0;
}

body.game-over main {
    height: auto;
    padding: 0 30px;
}

body.game-over .album {
    border-radius: 30px;
    padding: 30px;
    margin: 0 auto;
    max-width: 1500px;
    width: 100%;
}

body.game-over .album .photo-description {
    font-size: 25px;
}

body.game-over .slots-group__title {
    font-size: 20px;
    margin-bottom: 15px;
}

body.game-over .slot-number {
    font-size: 16px;
}

body.game-over .check-btn {
    display: block;
}

@media (max-width: 1680px) {
    .photos, .slots-group__items {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1600px) {
    .container {
        max-width: 100%;
        padding: 0 50px;
    }
}

@media (max-width: 1380px) {
    .photo-description {
        font-size: 18px;
    }

    .slot-number {
        font-size: 12px;
    }
}

@media (max-width: 980px) {
    .photos, .slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* @media (max-width: 900px) {
    .photos, .slots {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
} */

@media (max-width: 750px) {
    .photos, .slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .photos, .slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* @keyframes colorChange {
    0% {
      background: #5f00b8;
    }
  
    50% {
      background: #a855f7;
    }
  
    100% {
      background: #5f00b8;
    }
  } */