@font-face {
  font-family: 'Xanh Mono';
  src: url('../assets/XanhMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Xanh Mono';
  src: url('../assets/XanhMono-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Gipon Scrawl';
  src: url('../assets/Gipon Scrawl.otf') format('opentype');
}

body {
    font-family: 'Xanh Mono', serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-image: url("../assets/clean-textile.png"), linear-gradient(to right, #babfa0, #9f846d);
    background-size: auto, cover;
    text-transform: lowercase;
    text-align: center;
    display: flex;
}

body.title-page {
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.title-container {
    width: 100%;
    max-width: 800px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    overflow: auto;
    color: #675945;
    border-right: 2px solid #675945;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0em;
    animation: typing 3.5s steps(30, end) forwards, blink-caret 0.75s step-end infinite;
}

.title-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 300px;
    animation: slideUp 0.8s ease-out;
}

.title-btn, .modal-btn {
    font-family: 'Gipon Scrawl', serif;
    text-transform: lowercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(15, 48, 15, 0.8);
}

.title-btn {
    padding: 12px 30px;
    font-size: 1.2em;
    background-color: rgba(245, 255, 207, 0.8);
    width: 100%;
}

.title-btn:hover, .modal-btn:hover {
    background-color: rgba(203, 213, 163, 0.9);
    transform: translateY(-2px);
}

.title-btn:active, .modal-btn:active {
    transform: translateY(1px);
}

#loadGameBtn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    margin: 0 0 20px 0;
    color: #666;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #666;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 15px;
}

.modal-btn {
    padding: 10px 20px;
    font-size: 1rem;
    flex: 1;
}

.cancel-btn {
    background: rgba(230, 230, 230, 0.8);
}

.confirm-btn {
    background: rgba(245, 255, 207, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { transform: translateY(-10px); }
    to {  transform: translateY(0); }
}

@keyframes typing {
    from { width: 0 }
    to { width: 70% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #675945 }
}
/* 
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5em;
    }
    
    .title-btn {
        font-size: 1em;
        padding: 10px 20px;
    }
}
   */

.animated-stamps {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.stamp {
    position: absolute;
    width: 300px;
    height: auto;
    /* mix-blend-mode: screen; */
    opacity: 1;
    filter: brightness(100);
    animation: lilRotate 200s linear infinite;
}

.stamp-intro { 
    top: 2%; 
    left: 10%; 
    animation-delay: 0s; 
    transform: rotate(15deg);
    --rotation: 8deg;
}

.stamp-page1 { 
    bottom: 2%; 
    left: 30%; 
    animation-delay: -3s; 
    transform: rotate(-20deg);
    --rotation: -8deg;
}

.stamp-page2 { 
    top: 2%; 
    right: 2%; 
    animation-delay: -6s; 
    transform: rotate(25deg);
    --rotation: 8deg;
}

.stamp-page3 { 
    bottom: 6%; 
    right: 20%; 
    animation-delay: -9s; 
    transform: rotate(-15deg);
    --rotation: -8deg;
}

.stamp-finale { 
    top: 40%; 
    left: 0%; 
    animation-delay: -12s; 
    transform: rotate(30deg);
    --rotation: 10deg;
}

.stamp-companion { 
    top: 30%; 
    right: 0%; 
    animation-delay: -15s; 
    transform: rotate(-25deg);
    --rotation: -10deg;
}

.stamp-ending { 
    top: 5%; 
    left: 45%; 
    animation-delay: -18s; 
    transform: rotate(5deg);
    --rotation: 20deg;
}

@keyframes lilRotate {
    0% {
        transform: rotate(var(--rotation));
    }
    100% {
        transform: rotate(calc(var(--rotation) + 360deg));
    }
}