body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0edff;
    min-height: 100vh;
}


/* Games Page Specific Styles */
.games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#arrow-mobil{
  display: none;
}

.back-arrow {
    padding: 1.2rem;
    border-radius: 0.6rem;
    background-color: #dad2fe;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.back-arrow:hover {
    background-color: #e0d9ff;
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: #4c1d95;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translate(-50%);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.inici-button {
    background-color: #ff555c;
    color: white;
    padding: 0 1.2rem;
    height: 60px;
    border-radius: 0.6rem;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    
}

.inici-button:hover {
    background-color: #f4364c;
}

/* Games Content */
.games-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    margin-top: 2rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.game-header {
    /* height: 80px; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.game-icon {
    max-width: 4rem;
}

/* Header Colors */
.blue-header { background: linear-gradient(135deg, #4a90e2, #7bb3f0); }
.red-header { background: linear-gradient(135deg, #ff555c, #ff7a7a); }
.light-blue-header { background: linear-gradient(135deg, #7fa8da, #a8c8f0); }
.green-header { background: linear-gradient(135deg, #22c55f, #4ade80); }
.pink-header { background: linear-gradient(135deg, #fcafc0, #ffc9d4); }
.purple-header { background: linear-gradient(135deg, #8b84d7, #a29bdc); }
.teal-header { background: linear-gradient(135deg, #00ab84, #26d0ce); }
.purple2-header { background: linear-gradient(135deg, #9b4f96, #b565a7); }

.game-body {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0032A0;
    margin-bottom: 0.75rem;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    align-items: center;
}

.game-category-container{
  display: flex;
  gap: 0.2rem;
  flex-direction: column;  
}

.game-category {
    color: #0032A0;
    background-color: transparent;
    border: 1px solid #002080;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.game-duration {
    color: #0032A0;
}

.game-description {
    color: #4489CA;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.play-button {
    background: #0032A0;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.play-button:hover {
    background: #002080;
}

.movil {
    display: none;
}

.logo-ics-iguals{
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .games-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .page-title {
        order: 2;
        font-size: 1.4rem;
    }

    .header-right {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }

    .logoright {
        display: none;
    }

   

    #arrow-footer{
      display: none;
    }

    #arrow-mobil.back-arrow{
      position: static;
      transform: translateX(0);
      border-radius: 50%;
      background-color: #f0edff;
      display: flex;
      width: 50px;
      height: 50px;
      padding: 0;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .games-content {
        padding: 1rem;
        margin-top: 0rem;
    }
        .header {
        flex-direction: row;
        gap: 1rem;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .header img{
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        display: none;
    }

    .inici-button {
        background-color: #ff555c;
        color: white;
        padding: 1rem 1.2rem;
        border-radius: 50%;
        text-decoration: none;
        font-weight: bold;
        font-size: 0.7rem;
        transition: background-color 0.3s ease;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
        display: none;
    }

    .inici-button-rounded {
        background-color: #fff;
        font-size: 1.7rem;
        color: red;
        border-radius: 50%;
        text-decoration: none;
        font-weight: bold;
        transition: background-color 0.3s ease;
        /* box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15); */
        display: block !important;
        z-index: 2;
    }

    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 2rem 1rem;
    }

    .logomenu {
        width: 120px !important;
    }

    .card-large img {
        grid-row: span 1;
    }
    
    .card-small {
        grid-row: span 1;
    }

    .footer {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }

    .footer-left {
        flex-direction: row;
        gap: 1rem;
    }

    .phone-info {
        text-align: center;
        padding: 0.5rem 1rem;
        border: 2px solid #ff555c;
        border-radius: 8px;
        color: #ff555c;
        font-weight: bold;
        max-width: 200px;
        font-size: 0.6rem;
    }

    /* Modal */
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-result-item {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .modal-play-again-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

}

@media (max-width: 480px) {
    .movil {
        display: block !important;
    }

    .logo-pacte-movil{
        width: 17%;
    }

    .logo-espai-lila{
        width: 12%;
    }

    .logo-ics-iguals{
        width: 25%;
    }

    .logo-ics{
        width: 30%;
    }

    .logos-cuidem-igual{
        display: none;
    }

    .totem {
        display: none !important;
    }

    .footer-left {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.game-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.game-modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  color: #0032a0;
  font-size: 1.5rem;
  font-weight: bold;
}

.modal-close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.modal-close:hover {
  background: #f0f0f0;
}

.modal-results-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.modal-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #f8f9ff;
}

.modal-result-item i {
  font-size: 1.5rem;
}

.modal-result-item:nth-child(1) i {
  color: #22c55f;
}

.modal-result-item:nth-child(2) i {
  color: #c30000;
}

.modal-result-item:nth-child(3) i {
  color: #0032a0;
}

.modal-result-item:nth-child(4) i {
  color: #ff6200;
}

.modal-play-again-btn {
  background: #0032a0;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
}

.modal-play-again-btn:hover {
  background: #002080;
  transform: translateY(-2px);
}

/* game stats */
.game-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-success {
  color: #15803d;
  border-width: 2.5px;
  border-style: solid;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.stat-error {
  color: #dc2626;
  border-width: 2.5px;
  border-style: solid;
  border-color: #fecaca;
  background: #fef2f2;
}

.stat-warning {
  color: #ea580c;
  border-width: 2.5px;
  border-style: solid;
  border-color: #fed7aa;
  background: #fff7ed;
}

.stat-time {
  color: #002080;
  border-width: 2.5px;
  border-style: solid;
  border-color: #c9d6ff;
  background: #fafbff;
}

.stat-skipped {
  color: #c8591a;
  border-width: 2.5px;
  border-style: solid;
  border-color: #ffd7bf;
  background: #fff7ed;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 1rem;
  white-space: nowrap;
  font-weight: 500;
}

.bold{
  font-weight: bold;
}

@media (max-width: 768px) {
  .game-stats {
    gap: 0.4rem;
  }

  .stat-badge {
    font-size: 0.7rem;
    padding: 0.5rem 0.5rem;
    gap: 0.3rem;
    border-radius: 0.4rem;
  }

  .stat-badge i {
    font-size: 0.7rem;
  }
}

