/* Corpo */
* {
  box-sizing: border-box;
}

  body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sfondo_rosso{
    background-image: url("https://wjlmxnvrelazvbhrpegb.supabase.co/storage/v1/object/public/abisso-assets/img/sfondo_rosso.png");
    background-size: 2048px 2048px;
    background-repeat: repeat;
    }

    .sfondo_blu{
    background-image: url("https://wjlmxnvrelazvbhrpegb.supabase.co/storage/v1/object/public/abisso-assets/img/sfondo_blu.png");
    background-size: 2048px 2048px;
    background-repeat: repeat;
    }

    .sfondo_oro{
    background-image: url("https://wjlmxnvrelazvbhrpegb.supabase.co/storage/v1/object/public/abisso-assets/img/sfondo_oro.png");
    background-size: 2048px 2048px;
    background-repeat: repeat;
    }

    .sfondo_verde{
    background-image: url("https://wjlmxnvrelazvbhrpegb.supabase.co/storage/v1/object/public/abisso-assets/img/sfondo_verde.png");
    background-size: 2048px 2048px;
    background-repeat: repeat;
    }

    .sfondo_viola{
    background-image: url("https://wjlmxnvrelazvbhrpegb.supabase.co/storage/v1/object/public/abisso-assets/img/sfondo_viola.png");
    background-size: 2048px 2048px;
    background-repeat: repeat;
    }

  /* Stile per il dropdown */
select {
    background-color: #000;    /* Sfondo nero */
    color: #fff;               /* Testo bianco */
    border: 1px solid #a15a03;  /* Bordo con il colore specificato */
    padding: 8px;
    border-radius: 4px;
    /* Rimuove l'aspetto standard in alcuni browser (solo se necessario) */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  /* Stile per gli option (nel limite del possibile cross-browser) */
  select option {
    background-color: #000;
    color: #fff;
  }
  
  /* Gestione del focus */
  select:focus {
    outline: none;
    border-color: #a15a03;
  }
  

  h1 {
    color: #ffffff;
    text-align: center;
    margin-top: 20px;
  }

  .space{
    margin-top: 300px;
  }

  .reset{
    background-color:red;
  }
  
  
/* cards giocatori */  

.player-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
  }
  
  .section-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
  }
  
  #player-selector {
    width: 80%;
    max-width: 300px;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #121212;
    color: #fff;
  }
  
  .player-card {
    display: none; /* Nasconde tutte le card di default */
    width: 100%;
    max-width: 500px;
    background: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 10px 0;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ccc;
  }
  
  .player-card.active {
    display: flex; /* Mostra la card attiva */
  }

  .player-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #333;
    margin-bottom: 15px;
  }

  .player-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
  }

  .attribute {
    width: 100%;
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 1em;
  }

  .attribute-name {
      width: 80px; /* Larghezza fissa per allineare i nomi delle abilità */
      text-align: left;
      color: #aaaaaa;
  }

  .attribute-points {
    font-weight: bold;
    color: #ffffff;
  }

  .purchase-slot{
      width: 100%;
    align-items: left;
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    font-size: 1em
  }

  .btn-ration{
    margin-bottom: 15px;
  }

/* menu */  

    nav {
    background-color: #333;
    padding: 10px;
    text-align: center;
    }

    nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    }

    nav ul li {
    display: inline-block; /* Permette il margine su ogni elemento */
    margin-right: 10px;
    }

    nav ul li a {
    display: block; /* Aggiunge il bordo intorno al link */
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px; /* Spaziatura interna */
    border: 2px solid #ffffff; /* Bordo attorno a ciascun link */
    border-radius: 5px; /* Arrotonda leggermente i bordi */
    }

    nav ul li a:hover {
    background-color: #555;
    color: #dddddd;
    }

    .footer-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #333;
        color: #ffffff;
        z-index: 1000; /* Il menu deve stare sopra altri elementi della pagina */
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
    }

    .footer-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around;
    }

    .footer-nav li {
    position: relative; /* Posiziona i sottomenu rispetto ai pulsanti */
    flex: 1;
    text-align: center;
    }

    .footer-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    text-decoration: none;
    color: #ffffff;
    }

    .footer-nav a:hover {
    background-color: #555;
    }

    .submenu {
    display: none; /* Nascondi di default */
    position: absolute;
    bottom: 70px; /* Posiziona sopra il pulsante principale */
    left: 50%; /* Centra rispetto al pulsante */
    transform: translateX(-50%);
    background-color: #333; /* Sfondo del sottomenu */
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1100; /* Assicurati che il sottomenu sia sopra il footer */
    text-align: center;
    }

    .submenu li {
    display: flex;
    flex-direction: column;
    margin: 10px 0; /* Spaziatura verticale tra le opzioni */
    list-style: none; /* Rimuovi i pallini */
    width: 100%;
    }

    .submenu a {
    color: white;
    text-decoration: none;
    display: block; /* Crea un blocco per ogni link */
    padding: 10px 100px; /* Spaziatura interna */
    border-radius: 5px; /* Arrotonda leggermente */
    }

    .submenu a:hover {
    background-color: #555;
    }

/* Sezione Scrigni e poteri elementali */
    .chests-section {
        margin-top: 20px;
        width: 100%;
    }
  
    .chests-section h3, h5 {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .chests-container {
        display: flex;
        justify-content: space-between;
    }
    
    .chest {
        width: 40px;
        height: 40px;
        border: 2px solid #ffffff;
        border-radius: 5px;
        cursor: pointer;
        opacity: 0.1; /* Scrigno disabilitato */
        transition: opacity 0.3s;
    }
    
    .chest.active {
        opacity: 1; /* Scrigno abilitato */
    }

    .potion-section {
        display: flex;
        flex-wrap: wrap;
        gap: 10px; /* spazio tra gli elementi */
        justify-content: center; /* o space-between */
      }
      
      
      .potion-section .element img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
      }
      
    
    .elements-section {
        margin-top: 20px;
        margin-bottom: 20px;
        width:70%;
    }
    
    .elements-section h3, h5 {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .elements-container {
        display: flex;
        justify-content: space-around;
        padding-right: 20px;
    }
    
    .element {
        width: 50px;
        height: 50px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        overflow: hidden;
        cursor: pointer;
        opacity: 0.3; /* Elemento disabilitato */
        transition: opacity 0.3s;
    }
    
    .element.active {
        opacity: 1; /* Elemento abilitato */
    }
    
    .element img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Sezione Battaglia tra giocatori */

    .battle-container {
        max-width: 700px;
        margin: 20px auto;
        padding: 20px;
        background-color: #1e1e1e;
        border-radius: 10px;
    }
    
    .battle-container h1 {
        text-align: center;
    }
    
    .player-selection {
        display: flex;
        text-align: center;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
    }
    
    .player-column {
        flex: 1 1 calc(50% - 40px); /* Calcola la larghezza considerando i margini */
        max-width: 320px; /* Assicura che le colonne non superino il contenitore */
        background-color: #2a2a2a;
        padding: 20px;
        border-radius: 10px;
        margin: 10px;
    }
    
    .player-column h2 {
        text-align: center;
    }
    
    .player-stats {
        margin-bottom: 20px;
    }
    
    .player-stats p {
        margin: 5px 0;
    }
    
    .dice-input {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .dice-input label {
        display: block;
        margin-bottom: 5px;
    }
    
    .dice-input input {
        width: 100%;
        padding: 10px;
        background-color: #333;
        color: #fff;
        border: none;
        border-radius: 5px;
        text-align: center;
    }
    
    .battle-button {
        text-align: center;
    }
    
    .battle-button button {
        padding: 10px 20px;
        font-size: 1em;
        background-color: #333;
        color: #fff;
        border: none;
        border-radius: 5px;
    }
    
    .battle-result {
        margin-top: 20px;
        text-align: center;
        font-size: 1.2em;
    }

    .sacrifice-button {
        margin-top: 10px;
    }
      
    .sacrifice-button button {
        padding: 10px;
        font-size: 0.9em;
        background-color: #800000;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }
        
    .sacrifice-button button:hover {
        background-color: #a00000;
    }
    /* Media Queries */
    @media (max-width: 768px) {
        .player-selection {
        flex-direction: column;
        align-items: center;
        }
        .player-column {
        flex: 1 1 100%;
        max-width: 100%;
        margin: 10px 0;
        }
    }

    /* Sezione Master  */
    .effect-button {
        width: 45%;
        padding: 10px 20px;
        background-color: #333;
        color: #ffffff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .effect-button:hover {
        background-color: #555;
    }

    #active-effect {
        margin-top: 20px;
        font-size: 1.2em;
    }

    #effects-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .btn-refresh {
        padding: 10px 20px;
        background-color: #333;
        color: #ffffff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        margin-bottom: 20px;
    }

    .btn-refresh:hover {
        background-color: #555;
    }

    .dropdown-container {
    margin: 20px 0;
    text-align: center;
    }

    .data-display {
    margin-top: 20px;
    padding: 15px;
    background-color: #1e1e1e;
    border-radius: 10px;
    color: #ffffff;
    text-align: left;
    display: none;
    }

    .data-display p {
    margin: 5px 0;
    }

    .players-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    }

    .players-container button {
    padding: 10px;
    font-size: 1em;
    background-color: #7f7f7f;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    }

    .players-container button:hover {
    background-color: #ff8c00;
    }

 /* Sezione Mostri  */

    .monster-card {
        width: 90%;
        max-width: 500px;
        background: #1e1e1e;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        margin: 15px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .monster-photo {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #333;
        margin-bottom: 15px;
    }

    .monster-name {
        font-size: 1.5em;
        font-weight: bold;
        margin-bottom: 10px;
    }

    .attribute {
        width: 100%;
        align-items: center;
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        font-size: 1em;
    }

    .attribute-name {
        width: 80px; 
        text-align: left;
        color: #aaaaaa;
    }

    .attribute-points {
        font-weight: bold;
        color: #ffffff;
    }

    .dice-input-mostri {
        margin: 10px 0;
    }

    .dice-input-mostri label {
        margin-right: 10px;
    }

    .dice-input-mostri input {
        width: 50px;
        text-align: center;
    }

/* Sezione armi */

    .weapon-card {
        width: 90%;
        max-width: 400px;
        background: #1e1e1e;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        margin: 15px auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .weapon-photo {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #333;
        margin-bottom: 15px;
    }

    .weapon-name {
        font-size: 1.5em;
        font-weight: bold;
        margin-bottom: 10px;
    }

    .weapon-description {
        font-size: 1em;
        text-align: center;
        margin-bottom: 10px;
    }

    .weapon-attributes {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .cibo-card {
        width: 90%;
        max-width: 400px;
        background: #1e1e1e;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        margin: 15px auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cibo-photo {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #333;
        margin-bottom: 15px;
    }

    .cibo-name {
        font-size: 1.5em;
        font-weight: bold;
        margin-bottom: 10px;
    }

    .cibo-description {
        font-size: 1em;
        text-align: center;
        margin-bottom: 10px;
    }

    .cibo-attributes {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    .attribute {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .attribute-name {
        color: #aaaaaa;
        padding-left: 20px;
        padding-top: 10px;
    }

    .attribute-value {
        font-weight: bold;
        color: #ffffff;
        padding-left: 10px;
        padding-top: 10px;
    }

    button {
        padding: 10px 20px;
        font-size: 1em;
        background-color: #a15a03;
        color: #ffffff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        margin-top: 10px;
    }

    button:hover {
        background-color: #ff8c00;
    }

    .message {
        margin-top: 15px;
        font-size: 1.1em;
        text-align: center;
        color: #00ff00;
    }

    details {
        width: 90%;
        max-width: 800px;
        background-color: #1e1e1e;
        margin: 10px 10px;
        border-radius: 8px;
        overflow: hidden;
    }

    summary {
        padding: 15px;
        font-size: 1.5em;
        font-weight: bold;
        background-color: #2e2e2e;
        cursor: pointer;
    }

    summary::-webkit-details-marker {
        display: none;
    }

    summary::before {
        content: '▶';
        display: inline-block;
        margin-right: 10px;
        transform: rotate(0deg);
        transition: transform 0.2s;
    }

    details[open] summary::before {
        transform: rotate(90deg);
    }

    /* Sezione scrigni */

    .card {
        width: 90%;
        max-width: 400px;
        background: #1e1e1e;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        margin: 15px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .card-photo {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #333;
        margin-bottom: 15px;
    }

    .card-name {
        font-size: 1.5em;
        font-weight: bold;
        margin-bottom: 10px;
    }

        button {
      font-family: "Macondo", serif;
      background-color: #a13803;
      color: white;
      cursor: pointer;
      border: none;
      transition: background-color 0.3s ease;
      width: 100%;
    }

    button:hover {
        background-color: #ff8c00;
    }

/* Sezione Bande  */
    .banda-container{
        max-width: 900px;
    }

    .banda-card {
        font-family: "Macondo", serif;
        width: 90%;
        max-width: 900px;
        background: rgba(40,40,40,0.65); /* trasparenza */
      box-shadow:
        0 0 10px rgba(248, 62, 11, 0.59),
        0 6px 14px rgba(0,0,0,0.7);
        border-radius: 10px;
        
        margin: 15px;
        padding: 10px 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .banda-photo {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #333;
        margin-bottom: 15px;
      box-shadow:
        0 0 10px rgba(248, 62, 11, 0.59),
        0 6px 14px rgba(0,0,0,0.7);
    }
    
    .banda-name {
        font-size: 2em;
        font-weight: bold;
    }

    .select-player{
        text-align: center;
        margin-top: 20px;
    }
    
    .banda-reward, .banda-caratteristica {
        margin-top: 5px;
    }
    
    .dice-input-bande, .select-player {
        margin-top: 10px;
    }

    .player-characteristic {
        margin-top: 15px;
        font-weight: bold;
      }
    
    .message {
        margin-top: 10px;
        font-weight: bold;
        white-space: pre-wrap; /* Questa proprietà preserva le interruzioni di linea */
      }

      /* Sezione Eventi  */
    .evento-title{
        text-align: center;
    }

    /* === SHELL INTERNA APP: da aggiungere in fondo a style.css === */

    .page-shell {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 14px 110px; /* spazio sotto per footer fisso */
    box-sizing: border-box;
    }

    .app-panel {
    background: linear-gradient(180deg, #1a1a1a 0%, #111111 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    }

    .app-title {
    font-size: 1.9rem;
    line-height: 1.15;
    text-align: center;
    margin: 0 0 14px;
    color: #fff;
    }

    .app-subtitle {
    text-align: center;
    color: #d0d0d0;
    font-size: 0.98rem;
    line-height: 1.5;
    margin-bottom: 18px;
    }

    .app-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    }

    .app-section h2,
    .app-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #fff;
    }

    .app-button {
    width: 100%;
    min-height: 54px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .app-button:hover {
    transform: translateY(-1px);
    opacity: 0.96;
    }

    .app-button-primary {
    background: linear-gradient(180deg, #ff4a43 0%, #dc342e 100%);
    color: #fff;
    }

    .app-button-secondary {
    background: linear-gradient(180deg, #4b4b4b 0%, #3b3b3b 100%);
    color: #fff;
    }

    .app-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    }

    .app-card-cover {
    overflow: hidden;
    border-radius: 18px;
    background: #1c1c1c;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    }