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

#mastermind-game {
    background-color: azure;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

#header {
background: #003366;
margin-top: 10px;
color: #FFFFFF;
border-top: 2px solid rgba(255, 255, 255, 0.3);
border-bottom: 4px solid rgba(255, 255, 255, 0.9);
background: linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 0, transparent 75%, rgba(0, 0, 0, 0.15) 0),
linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 0, transparent 75%, rgba(0, 0, 0, 0.15) 0) 0.3em 0.3em,
radial-gradient(at 30% 0, #001f3f, #0038a8);
background-size: 0.6em 0.6em, 0.6em 0.6em, 100% 100%;
}

h1 {
    text-align: center;
    font-size: 55px;
    font-weight: bold;
    font-family: 'Alfa Slab One', serif;
    padding: 0;
    margin: 0;
    color: #FFFFFF;
    -webkit-text-stroke: 1px #C0C0C0;
    text-stroke: 1px #C0C0C0;
    text-shadow: 0 -1px 0 #909090,
                 -1px 0 0 #909090,
                 0 0.5px 0 #FEFEFE,
                 0 1px 0 #F5F5F5,
                 0 1.5px 0 #EBEBEB,
                 0 2px 0 #E0E0E0,
                 0 2.5px 0 #D4D4D4,
                 0 3px 1px rgba(0, 0, 0, .1),
                 0 0 2px rgba(0, 0, 0, .1),
                 0 0.5px 1.5px rgba(0, 0, 0, .3),
                 0 1.5px 2.5px rgba(0, 0, 0, .2),
                 0 2.5px 5px rgba(0, 0, 0, .25),
                 0 5px 5px rgba(0, 0, 0, .2),
                 0 10px 10px rgba(0, 0, 0, .15);
}

h1:hover {
    color: #FFFACD;
    text-shadow: 0 -1px 0 #5C4033,
                 -1px 0 0 #5C4033,
                 0 0.5px 0 #FFFACD,
                 0 1px 0 #FFD700,
                 0 1.5px 0 #DAA520,
                 0 2px 0 #B8860B,
                 0 2.5px 0 #A0522D,
                 0 0 15px rgba(255, 223, 0, 0.8),
                 0 5px 5px rgba(0, 0, 0, .3),
                 0 10px 10px rgba(0, 0, 0, .2);
}

p {
    text-align: center;
    font-weight: bold;
    margin: 0;
    min-height: 20px;
}

#cumulative-score {
    text-align: center;
    font-weight: bold;
    color: green;
    margin-bottom: 15px;
    padding: 5px;
    border: 1px dashed lime;
    border-radius: 5px;
      background: linear-gradient(180deg, #e6ffe6, #baffba);
    box-shadow:
        inset 0 0 10px rgba(0,128,0,0.3),
        0 3px 8px rgba(0,0,0,0.3);
        width:90%;
        margin: 0 auto;
        margin-bottom:10px;
}

#game-board {
    display: flex;
    flex-direction: column-reverse;
    padding-top: 8px;
    padding-bottom: 10px;
   
    margin: 0 auto 25px auto; 
    
    background-color: #032D6A;
    border-radius: 8px;
    border: 1px solid white;
    min-height: 70px;
    overflow: auto;
    background-image: url('design1.png');
    background-size: 100% 70px;
    background-position: top 10px right 0px;
    background-repeat: no-repeat;
    width: 98%; /* Pošto je širina manja od 100%, margin: auto će raditi */
}

.attempt-number {
    font-weight: bold;
    color: white;
    width: 10%;
    text-align: center;
    font-size: 1.5em;
    font-family: "Arial Black";
    margin-right: auto; 
    
}

.attempt-row {
    display: flex;
    align-items: center;
    padding: 3px 3px;
    background: #204ACB;
    width: 95%;
    margin: 3px auto;
    border-radius: 5px;
    border:1px solid white;

    
}

.guess-container {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
    flex: 0 0 52%;  

}

.key-container {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-left: 3px!important;
    flex: 0 0 20%; 

   }





.key-peg {
    width: 19px;
    height: 19px;
    border-radius: 50%;
}

.key-peg.black {
    background-color: green;
    border: 1px solid lime;
}

.key-peg.white {
    background-color: white;
    border: 1px solid green;
}

#current-guess {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.peg {
    width: 55px;
    height: 55px;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #eee;
    font-size: 2.7em;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
    border: 2px solid white;
    padding: 0px 3px;
}

.input-peg {
    width: 55px;
    height: 55px;
    border: 2px dashed green;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #99E6FF;
   
}

.input-peg {
    background: #9fe0ff; /* tvoja boja */
    border-radius: 10px;
    border: 2px solid cyan;

    /* 2D BEVEL – GORE/LEVO SVETLO, DOLE/DESNO TAMNO */
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.7),
        inset -1px -1px 0 rgba(0,0,0,0.35);

    font-size: 2.5em;
    cursor: pointer;
}




.input-peg:not(:empty) {
    border-style: solid;
    border-color: green;
}

.input-peg.active {
    border-color: midnightblue;
    border-style: solid;
}

#emoji-palette {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 25px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    width: 80%;
    background: #0073E6;
    padding-top: 6px;
    padding-bottom: 6px;
    padding-left: 3px;
    padding-right: 3px;
    flex-shrink: 0;
     border: 2px solid rgba(255,255,255,0.35);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 4px 12px rgba(0,0,0,0.4);
}

.emoji-choice {
    background: #EDEDED;
    width: 15%;
    font-size: 2.4em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1/1;
    line-height: 1;
    border-top: 2px solid white !important;
    border-left: 2px solid white !important;
    border-right: 2px solid silver !important;
    border-bottom: 2px solid silver !important;
    padding:5px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    flex-grow: 0;

}

.emoji-choice:active {
    transform: scale(0.98);
}

.emoji-choice:hover {
    transform: scale(1.1);
    border-color: #ff6b6b;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

#action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}



#submit-guess {
    background-color: #3498db;
    color: white;
    max-width: 200px;
    padding: 15px;
   border-top: 2px solid white !important;
    border-left: 2px solid white !important;
    border-right: 2px solid silver !important;
    border-bottom: 2px solid silver !important;
     border-radius: 6px;
}

#submit-guess:hover:not(:disabled) {
    background-color: #2980b9;
}

#submit-guess:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    padding: 5px;
}

#new-game {
    background-color: red;
    color: white;
    font-weight:bold;
    max-width: 200px;
    padding: 5px;
    border-radius:5px;
    border:2px solid tomato;
    cursor: pointer;
    font-size:18px;
}

#new-game:hover {
    background-color: #c0392b;
}

#level {
    font-size: 1.5em;
    font-weight: bold;
    color: #B22222;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    font-family: "Arial Black";
}

#message {
    text-align: center;
    font-weight: bold;
    margin: 5px 0;
    min-height: 10px;
    flex-shrink: 0;
}

#installApp {
    display:flex;
    justify-content: center;
    max-width:360px;
    margin: 0 auto; /* Ovo centrira ceo div horizontalno */
    font-size:17px;
    font-weight:bold;
    color:white;
    background:red;
    padding:9px;
    border-radius:5px;
    border:2px solid maroon;
    cursor:pointer;
}

#installApp:hover {
   color:white; 
   background:maroon;
   padding:12px;
   border:2px solid red;
} 

.hidden {
    display: none !important;
}
.noviRekord {
    font-family: Arial, sans-serif;
    color: darkorange;
    -webkit-text-stroke: 2px #ffea00;               /* slightly thicker + brighter yellow */
    paint-order: stroke fill;
    font-size: 27px;
    font-weight: bold;
    letter-spacing: 1px;                            /* optional – looks punchier */
    text-transform: uppercase;                      /* optional – common for "NOVI REKORD" */
}

#toplista h2 {
      font-family: 'Segoe UI', sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 20px;
            text-align:center;
}


table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            border-bottom: 2px solid #333;
            padding: 12px;
            color: #888;
        }

        td {
            padding: 12px;
            border-bottom: 1px solid #252545;
        }
        
        
         .leaderboard-card {
            background: var(--card);
            border-radius: 15px;
            padding: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            margin-bottom: 20px;
        }
        
        
              .rank {
            font-weight: bold;
            color: var(--primary);
            width: 50px;
            font-size: 1.1rem;
        }

        .points {
            text-align: right;
            color: red;
            font-weight: bold;
        }

        .back-btn {
            display: block;
            width: fit-content;
            margin: 50px auto;
            text-decoration: none;
            color: var(--bg);
            background: var(--primary);
            padding: 12px 25px;
            border-radius: 8px;
            font-weight: bold;
        }
        

@media (max-width: 500px) {
    h1 { font-size: 50px; }
    #mastermind-game { border-radius: 10px; box-shadow: 0; width: 100%; display: flex; flex-direction: column; margin: 0; }
  
    .guess-container { display: flex; gap: 5px; flex-shrink: 0;  }
    #emoji-palette { gap: 7px; width: 85%; }
    .peg { width: 55px; height: 55px; }
    .emoji-choice { border: 2px solid #ccc; }
    .key-peg {
    width: 18px;
    height: 18px;

}
.key-container {
 flex: 0 0 20%;  
    
   }
}

@media (max-width: 490px) {
    h1 { font-size: 45px; }
    
    #emoji-palette { gap: 6px; width: 90%; }
.guess-container { display: flex; gap: 6px; flex-shrink: 0; }
    .key-container { display: flex; gap: 3px; flex-shrink: 0; margin-right: 0; }
    .peg { width: 51px; height: 55px; border-radius: 5px; }
}

@media (max-width: 475px) {
    h1 { font-size: 43px; }
    .attempt-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 3px; margin-top: 5px; }

    .emoji-choice { border: 2px solid #ccc;  }
    #emoji-palette { gap: 5px; }
    #game-board { display: flex; flex-direction: column-reverse; padding-top: 8px; width:97%; padding-bottom: 10px; margin-bottom: 25px; 
    border-radius: 8px; border: 1px solid #ddd; min-height: 60px; overflow: auto; background-image: url('design1.png'); 
    background-size: 100% 60px; background-repeat: no-repeat; background-position: top 10px right 2px; }
    .key-container { gap: 3px; }
    .peg { width: 50px; height: 50px;}
    .key-peg { width: 16px; height: 16px; }
    .input-peg { width: 55px; height: 55px; display: flex; justify-content: center; align-items: center; font-size: 1.8em; cursor: pointer; transition: border-color 0.2s; }
}

@media (max-width: 450px) {
    h1 { font-size: 42px; }
    #game-board { display: flex; flex-direction: column-reverse; width:96%; padding-top: 8px; padding-bottom: 10px; margin-bottom: 25px;  border-radius: 8px; 
    border: 1px solid #ddd; min-height: 55px; overflow: auto; 
    background-image: url('design1.png'); background-size: 100% 55px; background-repeat: no-repeat; background-position: top 10px right 2px; width: 100%; }
   .attempt-row { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
    .guess-container { display: flex; gap: 5px; flex-shrink: 0; flex: 0 0 50%;}
    
    
    .key-container { gap: 3px; }
    .peg { width: 48px; height: 48px; font-size: 2.3em; }
    .key-peg { width: 15px; height: 15px; }
    .input-peg { width: 50px; height: 50px; align-items: center; font-size: 1.9em; }
}

@media (max-width: 425px) {
    #game-board { min-height: 55px; width:96%; background-position: top 10px left 10px right 10px; }
    .key-container { gap: 3px; }
    #emoji-palette { gap: 4px; }
    .guess-container { gap: 5px; width: 65%;}
    .peg { width: 45px; height: 45px; font-size: 2.1em; }
    .emoji-choice { font-size: 1.9em; }
    .attempt-row { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
    .attempt-number { font-size: 1.5em;}
}

@media (max-width: 400px) {
    #game-board { min-height: 60px; margin: 0 auto;  
       background-image: url('design1.png'); background-size: 99% 57px; background-repeat: no-repeat; background-position: top 10px right 2px; width: 99%; }  
       
#current-guess {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}
        
    .attempt-row { display: flex; align-items: center; justify-content: space-between; border-radius: 5px; }
    .emoji-choice { font-size: 2.2em;  }
    .guess-container { gap: 6px; }
    .key-container { gap: 2px; flex: 0 0 22%;}
    .attempt-number { font-size: 1.4em; }
    .peg { width: 40px; height: 40px; font-size: 2.2em; }
    .input-peg { font-size: 2.2em; }
}

@media (max-width: 360px) {
     #game-board { min-height: 50px; margin: 0 auto;  
       background-image: url('design1.png'); background-size: 99% 55px; background-repeat: no-repeat; background-position: top 6px right 2px; width: 99%; }  
    .attempt-row { display: flex; align-items: center; justify-content: space-between; width: 95%; margin-top: 5px; }
    .key-container { gap: 2px;  flex: 0 0 17%;}
    #emoji-palette { gap: 3px; width: 93%; }
    .attempt-number { font-size: 1.2em; }
     .guess-container { gap: 5px; flex: 0 0 65%;}
    .peg { width: 39px; height: 37px; font-size: 1.8em; }
    .key-peg { width: 10px; height: 10px; border: 1px solid white; }
    .key-peg.black { width: 10px; height: 10px; }
     .input-peg { width: 45px; height: 45px; align-items: center; font-size: 1.9em; }
     
      #installApp {
    max-width:90%;
   
} 
     
}
@media (max-width: 340px) {
    #game-board { min-height: 50px; }
    .attempt-row { display: flex; align-items: center; justify-content: space-between; width: 95%; margin-top: 5px; }
    .key-container { gap: 2px;  flex: 0 0 18%;}
    #emoji-palette { gap: 3px; width: 93%; }
    .attempt-number { font-size: 1.2em; }
     .guess-container { gap: 5px; flex: 0 0 70%;}
    .peg { width: 39px; height: 37px; font-size: 1.8em; }
    .key-peg { width: 10px; height: 10px; border: 1px solid white; }
    .key-peg.black { width: 10px; height: 10px; }
     .input-peg { width: 45px; height: 45px; align-items: center; font-size: 1.9em; }
}
@media (max-width: 320px) {
    h1 { font-size: 30px; }
    
    #emoji-palette { gap: 3px; width: 85%; }
     .input-peg { width: 40px; height: 40px; align-items: center; font-size: 1.8em; }
     .guess-container { display: flex; gap: 2px; flex: 0 0 60%; }
     .peg { width: 35px; height: 42px; font-size: 1.8em; }
     .key-container { gap: 2px; flex: 0 0 19%;  }
     .emoji-choice {width: 40px; height: 35px; font-size: 1.9em; padding:10px 5px;}
}

@media (max-width: 300px) {
    
    
    .key-container { gap: 1px; }
    .peg { width: 25px; height: 30px; font-size: 1.5em; }
    .guess-container { display: flex; gap: 3px; flex: 0 0 60%; }
     .key-container { gap: 2px; flex: 0 0 18%;  }
    #game-board { padding: 0px; margin-bottom: 20px;  border-radius: 2px; min-height: 50px; 
    background-size: 99% 45px; background-repeat: no-repeat; background-position: top 5px right 2px; width: 99%;}
    #emoji-palette { display: flex; width: 82%; gap: 1px; justify-content: center; margin-bottom: 20px; }
    .emoji-choice { font-size: 1.5em; width: 33px; height: 38px; }
    .attempt-number { font-size: 1.1em; }
    
    .key-peg {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.key-peg.black {
    background-color: lime;
    border: 0;
}

.key-peg.white {
    background-color: white;
    border: 0;
}
    
}

@media (max-width: 250px) {
    #a { display: none; }
}		