html, body { height: 100%; margin: 0; }
body { 
    display: flex; 
    flex-direction: column; 
    overflow: auto;
    background-image: url("assets/papiro.png");
}

header {
  top: 0;
  z-index: 1000;
  height: 120px; 
  background-image: url("assets/logo.png");
  background-repeat: no-repeat;
  background-position: left;   
  background-size: contain;   
  padding-bottom: 80px;
}

footer{
    margin-top: 70px;
    background-color: #7a5c2f;   
    color: #fefaf3;              
    padding: 15px 10px;          
    text-align: center;          
    font-size: 16px;             
    line-height: 1.6;            
}
#container {
    background-image:url("assets/papiro.png") ;
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 6px;
    min-height: 90vh;
}

#table {
    grid-column: 1 / 2; 
    width: 100%;
    border-collapse: collapse;
    background-image: url("assets/dragonfondo.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    overflow-y: auto;
    position: relative; 
    text-shadow: 1px 1px 2px #000;

}

.table_buttons{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  position: relative;
}
th, td {
    border: 1px solid #ffff ;
    color: #ffff;
    padding: 10px;
}

.highlight {
  outline: 3px solid goldenrod;  
  outline-offset: -3px;     
}
#round_counter{
    color: #ffff;
}
#creature_stats {
    grid-column: 2 / 3;
    border-left: 1px solid #ccc;
    padding-left: 10px;
    display: flex;
    gap: 10px;         
    align-items: flex-start;
}
#current_statBlock, #viewer_statBlock {
  flex: 1 1 50%;
  max-height: 500px;   
  overflow-y: auto;   
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 6px;
}

#creature_stats > #current_statBlock:only-child {
  flex: 1 1 100%;
}

#viewer_statBlock .closeBtn {
  display: inline-block;
  margin-left: 90%;
  
}

#create_homebrew_form {
    max-height: 500px;
    overflow-y: auto;
    min-height: 0;      
    display: none;
}
button {
    background: none;
    color: #ffff;
    border: 1px solid #ffff;
}
button:not(.dice):hover{
    background: transparent;
    border: 1px solid goldenrod;  
    color: #f0f0f0;
    /*padding: 4px 2px;*/
}

.dialog{
    background-image: url("assets/fondoDialog.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    color: #f5e6b3;
    text-shadow: 1px 1px 2px #000;
    }
.dialog section:nth-of-type(2) {
  margin-left: 40px; 
}

.dialog button {
  background: transparent;
  border: 1px solid #f0f0f0;
  color: #f0f0f0;
  padding: 6px 12px;
  border-radius: 4px;
}
.dialog button:hover {
  background: #8ca0b3; 
  color: #1a1a1a;      
}
.dialog li:hover {
  border: 1px solid #8ca0b3;  
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

#dice_container {
    position: absolute;
    top: 45px;        /* just below the toggle */
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px;
    z-index: 1200;    /* over the table */
}
#dice_ui{
  position: absolute;
  top: 8px;
  right: 8px;
}
.dice-row {
    display: flex; 
    align-items: center;
    gap: 6px;
}
#dice_toggle{
    width: 35px;            
    height: 35px;
    border: none;
    padding: 0;
    display: inline-block;
    flex: 0 0 35px;           
    justify-content: center;
}
#dice_toggle img {
  width: 100%;      
  height: 100%;
  object-fit: contain;
}
.dice-row .dice {
  flex: 0 0 auto;          
}
.dice {
    all: unset;
     width: 35px;      
    height: 35px;
    cursor: pointer;
}
.dice img{
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.roll{
    width: 35px;      
    height: 35px;
    padding: 0;
    border: none;
    animation-name: roll;
    animation-duration: 2s;
}

@keyframes roll{
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

