/* Font imports */
@font-face {
    font-family: 'Love Coffee';
    src: url('fonts/love-coffee.ttf') format('truetype');
}

@font-face {
    font-family: 'Glass Antiqua';
    src: url('fonts/glass-antiqua.ttf') format('truetype');
}

 @-webkit-keyframes scale-up-center {
    0% {
      -webkit-transform: scale(0.7);
              transform: scale(0.7);
    }
    100% {
      -webkit-transform: scale(1);
              transform: scale(1);
    }
  }
  @keyframes scale-up-center {
    0% {
      -webkit-transform: scale(0.7);
              transform: scale(0.7);
    }
    100% {
      -webkit-transform: scale(1);
              transform: scale(1);
    }
  }
  
  

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f5e9d9;
    color: #5d4037;
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: url(images/pattern1.jpg) !important;
    background-size: contain;

}

.game-title, h2 {
    font-family: 'Love Coffee', sans-serif;
    font-size: 2.5rem;
    color: #6f3d17;
    text-align: center;
    margin-bottom: 30px;
    /* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 3px 3px 9px rgba(79,47,15,.54); */
}

.h2_game-title {
    color: #f5e9d9; 
}

.pulseIMG {
    width: 8rem; margin-bottom: 2rem;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
    transform: scale(1);
    -webkit-animation: scale-up-center 0.8s cubic-bezier(0.390, 0.575, 0.565, 1.000) infinite alternate both;
	        animation: scale-up-center 0.8s cubic-bezier(0.390, 0.575, 0.565, 1.000) infinite alternate both;
}

button {
    background-color: #5d4037;
    color: #f5e9d9;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #f9f0e3 url(images/button.svg) no-repeat 100% 100%;
    background-size: contain;
    color: #6F3C17;
    font-family: 'Love Coffee', sans-serif !important;
    font-size: .85rem;
    box-shadow: 0 0 20px rgba(163, 41, 11, .25);
}

button:hover {
    background-color: #f5e9d9;
    color: #795548;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.settings-btn {
    position: absolute;
    top: 4rem;
    font-size: 1.3rem;
    background-color: #795548;
    color: white;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.back-btn {
    position: absolute !important;
    font-size: 1.3rem;
    /* background-color: #795548;
    color: white; */
    color: #795548;
    background-color: #f5e9d9;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;

    top: auto;
    bottom: .5rem;
    left: auto;
    right: .5rem;
}

.settings-btn {
    right: 20px;
}

.back-btn:hover, .settings-btn:hover {
    background-color: #5d4037;
    transform: scale(1.1);
}

/* Splash Screen */
#splash-screen {
    background-color: #6f3d17;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.splash-image {
    width: 50%;
    max-width: 400px;
    border-radius: 20px;
    margin-bottom: 30px;
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); */
}

.loading-bar {
    width: 80%;
    max-width: 300px;
    height: 10px;
    background-color: #d7ccc8;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 20px;
}

.loading-progress {
    height: 100%;
    width: 0;
    background-color: #795548;
    border-radius: 5px;
    transition: width 3s ease-in-out;
}

#splash-screen .game-title {
    color: #f5e9d9;
}

/* Home Screen */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    min-height: 65vh; 
    padding: 3rem;
    background-color: #f5e9d9;
    border-radius: 0;  /* Changed from 2rem to 0 */
    position: relative;
}

/* Add these new styles for the top and bottom images */
.home-content::before,
.home-content::after {
    content: '';
    display: block;
    width: 100%;
    height: 50px;
    max-width: 600px;
    position: absolute;
    left: 0;
    background-repeat: no-repeat;
}

.home-content::before {
    top: -1px;
    background-image: url(images/top.svg);
    background-size: 100% auto;
}

.home-content::after {
    bottom: -.6rem;
    background-size: 100% 100%;
    background-image: url('images/bottom.svg');
    background-repeat: repeat no-repeat;
    background-position: 0 bottom;
    transform-origin: center bottom;
}

.game-selection {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    font-size: 1.2rem;
    border-radius: 15px;
}

.game-btn i {
    font-size: 1.5rem;
}

/* Settings Screen */
.settings-content {
    width: 100%;
    max-width: 500px;
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.settings-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #6f3d17;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item label {
    font-size: 1.1rem;
}

.setting-item select {
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid #bcaaa4;
    background-color: #f5f5f5;
    font-size: 1rem;
}

.copyright {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #8d6e63;
}

/* Game 1 Screen */
.game1-content {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 85vh;
    position: relative;
}

/* Modifica per unire tentativi e suggerimenti */
.game-info-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border: 2px solid #795548;
}

.attempts-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding: 0;
    margin-right: 2rem;
}

.hint-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.attempts-counter i {
    font-size: 1.2rem;
    color: #795548;
}

.attempts-counter span:first-child {
    font-weight: bold;
}

.hint-message i {
    font-size: 1.2rem;
    color: #795548;
}

.range-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.range-value {
    background-color: #f5e9d9;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid #795548;
}

.range-separator {
    font-size: 2rem;
    font-weight: bold;
    color: #795548;
}

.guess-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
    max-width: 600px;
}

#guess-input {
    width: 100%;
    border: 2px solid #795548;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.5rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    outline: none;
}

#guess-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 15px 30px;
    font-size: 1.2rem;
}

.coffee-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.coffee-bean, .coffee-cup {
    position: absolute;
    opacity: 0.2;
}

.coffee-bean {
    width: 60px;
}

.coffee-cup {
    width: 80px;
}

.bean1 {
    top: 10%;
    left: 10%;
    transform: rotate(30deg);
}

.bean2 {
    bottom: 15%;
    right: 15%;
    transform: rotate(-20deg);
}

.cup1 {
    top: 20%;
    right: 10%;
}

.cup2 {
    bottom: 10%;
    left: 15%;
}

/* Game 2 Screen */
.game2-content {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
}

.board-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    margin-top: 0;
    padding: 15px;
    padding-right: 1.3rem !important;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    justify-items: center;
}

.board-number {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #f5e9d9;
    border: 2px solid #795548;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.board-number:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.board-number.selected {
    background-color: transparent;
    color: transparent;
}

.board-number.selected::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.board-number.coffee-bean::before {
    background-image: url('images/coffee_bean.png');
}

.board-number.coffee-cup::before {
    background-image: url('images/coffee_cup.png');
}

.lose-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 300px;
    padding: 15px 30px;
    font-size: 1.2rem;
    /*background-color: #d32f2f;*/
    z-index: 100;
    transition: background-color 0.3s ease;
}

.lose-btn:hover {
    /*background-color: #b71c1c;*/
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translate(-50% , -2px);
}

/* Win Screen */
.win-content {
    width: 100%;
    max-width: 500px;
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.win-content h2 {
    color: #6f3d17;
    margin-bottom: 20px;
    font-size: 2rem;
}

.win-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.coffee-celebration {
    margin: 30px 0;
}

.celebration-cup {
    width: 150px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0);
    }
}

#play-again-btn, #home-btn {
    margin: 10px;
}

/* Range colors for Game 1 */
.range-value.green {
    background-color: #a5d6a7;
}

.range-value.yellow {
    background-color: #fff59d;
}

.range-value.orange {
    background-color: #ffcc80;
}

.range-value.red {
    background-color: #ef9a9a;
}

/* Nascondi il titolo del gioco 1 */
#game1-screen h2 {
    /* display: none; */
    font-size: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .range-container {
        flex-direction: row;
        gap: 10px;
        padding: 10px;
    }
    
    .range-value {
        min-width: 8rem;
        padding: 2rem 2rem;
        font-size: 2rem;
    }
    
    .range-separator {
        font-size: 1.8rem;
    }
    
    #guess-input {
        font-size: 1.3rem;
        padding: 15px;
    }
    
    #guess-btn {
        font-size: 1.1rem;
        padding: 12px 25px;
    }
    
    .board-container {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .board-number {
        font-size: 1rem;
    }
    
    .coffee-bean {
        width: 40px;
    }
    
    .coffee-cup {
        width: 60px;
    }
    
    .lose-btn {
        bottom: 10px;
        padding: 12px 25px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .game-btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    .board-container {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        grid-template-columns: repeat(auto-fit, minmax(3rem, 1fr));
        gap: 6px;
        padding: 8px;
    }
    
    .board-number {
        font-size: 0.9rem;
    }
    
    .guess-input-container {
        flex-direction: column;
    }
    
    #guess-btn {
        width: 100%;
    }
}

/* Stile per il pulsante play-again-btn nella schermata di vittoria */
#win-screen .back-btn {
    position: absolute !important;
    top: auto;
    bottom: .5rem;
    left: auto;
    right: .5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #6f3d17;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0;
    margin: 0;
}

#win-screen .back-btn:hover {
    background-color: #5d4037;
    transform: scale(1.1);
}

.back-btn:hover {
    background-color: #5d4037;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.back-btn i {
    font-size: 1.3rem;
    margin: 0;
    padding: 0;
}

/* Stili per la sezione degli ordini di caffè */
.coffee-order-section {
    width: 100%;
    margin: 20px 0;
    background-color: rgba(245, 233, 217, 0.8);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.coffee-order-section h3 {
    font-family: 'Love Coffee', cursive;
    color: #6f3d17;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.coffee-input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.coffee-input-container label {
    font-weight: bold;
    color: #5d4037;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    background-color: #795548;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #5d4037;
    transform: scale(1.1);
}

.coffee-quantity {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 1.1rem;
    margin: 0 8px;
    background-color: transparent;
}

/* Stili per la lista degli ordini nelle impostazioni */
.last-coffee-order {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(245, 233, 217, 0.8);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.last-coffee-order h3 {
    font-family: 'Love Coffee', cursive;
    color: #6f3d17;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
}

#coffee-order-list {
    background-color: white;
    border-radius: 10px;
    padding: 10px;
}

.coffee-order-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.coffee-order-item:last-child {
    border-bottom: none;
}

.coffee-order-item span:first-child {
    font-weight: bold;
    color: #5d4037;
}

/* Responsive per gli ordini di caffè */
@media (max-width: 480px) {
    .coffee-input-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .quantity-control {
        width: 100%;
        justify-content: flex-end;
    }
}