:root{
   --bg: linear-gradient(16deg, rgba(0, 0, 50, 1) 0%, rgba(0, 0, 150, 1) 50%, rgba(0, 200, 255, 1) 100%);
  

   --accent: #9bbaf7;
   --muted: #caced1;

  }

    body{
    min-height: 100vh;
    text-align: center;
    color: #222;
    font-family:Arial,  sans-serif;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
   flex-direction: column;
    
   
    
  }
  footer{
    
    margin-top:5px;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #aaa;
  }
  h1{
    margin-top: 5px;
    margin-left: 10px;
    color:#333;
  }
  .title{
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .logo{
    width:60px;
    height: 68px;
    vertical-align:middle;
    filter: drop-shadow(0 0 6px #ffffff)
            drop-shadow(0 0 12px #a64ca6);
 
  }
  .subtitle{
    font-size: 18px;
    color: var(--muted);
    margin-top: 8px;
  }
  button{
    display: inline-block;
    margin: 10px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background: #007bff;
    color: white;
    transition: 0.3s;
  }
  button:hover{
    background: #0056b3;
  }

  .avatar-grid{
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
   justify-content: center;
   align-items: center;
    margin-top: 8px;
  }
  .avatar{
    width: 74px;
    height: 74px;
    border-radius: 12px ;
    background: #fbf5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    
    overflow: hidden;
   
   cursor: pointer;
   border: 3px solid transparent;
   /* transition: tranform .14s ease , box-shadow .14s; */
    /* box-sizing: border-box; */
     transition: all 0.25s ease; /* smooth animation */

  
  }
.avatar:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
  
}
.avatar.selected{
   transform: translateY(-10px) scale(1.05);
  box-shadow: 0 0 0 10px var(--accent);
  /* border:10px solid var(--accent); */
   border-color: var(--accent);
  
 
  animation:glow 1.5s infinite alternate;/*glow animation*/

}
/* 🔥 Glow animation */
@keyframes glow {
  0% {
    box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
  }
  100% {
    box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent);
  }
}



 .avatar picture , .avatar img,.player-avatar img,.player-avatar picture{
    width: 100%;
    height: 100%;
    object-fit: cover;

  }

  #muteBtn{
    display: flex;
    align-items: center;
    gap: 6px;
    width:130px;
    padding: 12px 20px 12px;

 }
  /* .container{
   width: 100%;
    max-width:980px;
    background:transparent;
    display:grid;
    gap:20px;   
  
  }  */

/*START SCREEN*/
#start-screen{
 background: #370659;
background: linear-gradient(302deg, rgba(55, 6, 89, 1) 1%, rgba(120, 64, 168, 1) 13%, rgba(105, 34, 122, 1) 40%, rgba(120, 14, 111, 1) 61%, rgba(204, 51, 181, 1) 100%);
 padding: 32px;
 box-shadow: 0 10px 30px rgba(20, 30, 60, 0.08);
 display: flex;
 flex-direction: column;
 gap: 18px;
 border-radius: 18px;
 align-items: center;


}
.controls{
width: 100%;
display: flex;
gap: 12px;
align-items: center;
justify-content: center;


}
.name-input{
  display: flex;
  gap: 8px;
  align-items: center;
}
.name-input input{
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 16px;
  width: 260px;
}
#game-screen{
  display: none;/*Show after play*/
  background:  #370659;
background: linear-gradient(302deg, rgba(55, 6, 89, 1) 1%, rgba(120, 64, 168, 1) 13%, rgba(105, 34, 122, 1) 40%, rgba(120, 14, 111, 1) 61%, rgba(204, 51, 181, 1) 100%);
  flex-direction: column;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, 0.6);
}
.topbar{
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 10px;
}
.player-info{
  display: flex;
  gap: 12px;
  align-items: center;
}
.player-avatar{
   width: 74px;height: 74px;
   border-radius: 10px ;
  
  display: flex; align-items: center;justify-content: center;
  overflow: hidden;
  font-size: 30px;
  border: 3px solid white;

  flex-shrink: 0; /* 🔒 Prevent shrinking */
  flex-grow: 0; /* 🔒 Prevent growing */
}

.choices{
justify-content: center;
display:flex ;
gap: 4px;


}
  /* Scoreboard Styling*/
  #score-board{
    margin: 20px auto;
    padding: 15px;
    width: fit-content;
    text-align: center;
    background:#222;
    color:#fff;
    border-radius: 12px;
    box-shadow:  0px 4px 8px rgba(0,0,0,0.3);
  }

  #score-board h2{
 margin-bottom: 10px;
 font-size: 20px;
 text-transform: uppercase;
 color: #ffcc00;

  }
 
 .scores{
  display: flex;
  gap: 15px;
  font-size: 18px;
  font-weight: bold;
  justify-content: center;
 }

 .scores span{
  padding: 5px 12px;
  border-radius: 8px;
  background: #333;
 }

 #user-score{ background-color: #28a745;}/*green for wins*/
 #computer-score{ background: #dc3545;}/*red for losses*/
 #tie-score {background: #6c757d;}/*gray for ties*/

#result{
  min-height: 40px;
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
  color: #f7e2f9;
  /* NEW STYLES */
  text-align: center; /* centers text horizontally */
  white-space: pre-line;/* respect \n newlines in innertext */
}
#attempts-left{
  margin-top: 10px;
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: large;
}
/*Fullscreen overlay after game ends */
#end-screen{
  display: flex;/*✅Shown by default*/
  background-color: #28a745;
  position:fixed ;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: white;
  font-size: 50px; /*changed🧧*/
  font-weight: bold;
  justify-content: center;  
  align-items: center;
  z-index: 1000;
  text-align: center;
  flex-direction: column;
  padding: 20px;

  opacity:0;
  transform: scale(1.2); 
  filter: blur(10px);
  pointer-events: none;

   /* Animation */
  transition: opacity 0.8s ease, transform 0.8s ease,filter 0.8s ease;
  
}
#end-screen.show{

  opacity: 1;
  visibility: visible;
  transform: scale(1);
  filter: blur(0px);
  pointer-events: auto;

}
#end-message{
  margin-bottom:20px;
}
#play-again{
  box-shadow: 0px 6px  12px rgba(0, 0, 0, 0.7);
  font-weight: bold;
  padding:12px 24px ;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  background:#ff9800;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}
#play-again:hover{
  background: #e68900;
  transform: scale(1.1);
 
}
#feedbackBtn{
  padding: 12px 24px;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background:linear-gradient(135deg,#ff9800,#ff5722);
  color: white;
  box-shadow:0 6px 12px rgba(0,0,0,0.5);
  animation: pulse 1.5s infinite;
  z-index: 1000;
}
@keyframes pulse{
  0%{transform: scale(1); }
  50%{transform: scale(1.1); }
  100%{transform: scale(1);}
  
}
#feedbackModal{top: 0;left: 0;display: none;
  position: fixed;width: 100%;height: 100%;
  background: rgba(0, 0, 0, 0.7);justify-content: center;align-items: center;z-index: 10000;
 
}
#feedback{
   background:linear-gradient(135deg,#370659,#8040a8,#cc33b5);
   padding: 30px;
   border-radius: 20px;
   max-width: 400px;
   width: 90%;
   color: white;
   text-align: center;
   position: relative;
   font-size:20px;
}
#toast {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-message {
  padding: 15px 25px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 15px;
  min-width: 220px;
  max-width: 300px;
  text-align: left;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  animation: slideIn 0.4s ease, fadeOut 0.4s ease 3s forwards ;
}

.toast-success { background: #28a745; }   /* green */
.toast-error   { background: #dc3545; }   /* red */
.toast-warning { background: #ff9800; }   /* orange */

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}


/*🔻🚨🚨🚨New code for mobile phones* 🔻🚨🚨🚨*/
/* RESPONSIVE DESIGN FIXES */
 @media (max-width:480px) {
  

  /* End screen */
  #end-screen {
   display: flex;                 /* enable flexbox */
  justify-content: center;       /* horizontal center */
  align-items: center;           /* vertical center */
  flex-direction: column;        /* stack children */
  height: 100vh;                 /* full screen height */
  width: 100%;                   /* full width */
  padding: 16px;
  text-align: center;
  box-sizing: border-box;
  }

  #end-message {
     font-size: clamp(24px, 6vw, 40px); /* bigger & responsive */
  word-wrap: break-word;             /* wrap long text */
  max-width: 90%;                    /* avoid overflow */
  line-height: 1.4;                  /* spacing between lines */
  }

  #play-again {
    
    font-size: 16px;
    padding: 10px 18px;
  }

 #muteBtn{
    display: flex;
    align-items: center;
    gap: 6px;
    width:140px;
    padding: 10px 20px 10px;
    box-sizing: border-box;

 }
  #start-screen{
  /*🔷 Responsiveness*/
  width: 90%;
  max-width: 500px;
  margin: 20px auto;
  box-sizing: border-box;

 }
 #game-screen{
  width: 90%;
  max-width: 400px;
  margin: 20px auto;
  padding: 12px;
}
.controls{
  width:100%;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap:wrap ;/*Wrap buttons on smaller screens*/
}
.name-input{
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap/*Wrap label and input on very small screens*/;  
justify-content: center;
}

.name-input input{
 max-width: 100%;
 width:220px ;/*Slightly smaller on mobile screen*/

}
.title{
  font-size: clamp(38px,6vw,42px);
  /* flex-direction: column; */
  gap:1px;
   justify-content: center; /* center logo + text */
}
.logo{
    width:75px; 
    height:90px;
  }
  .subtitle{
    font-size: clamp(18px,4vw,20px);
    margin-top: 4px;
    text-align: center;
  }
  button{
    font-size:clamp(18px,3vw,20px);
    
  }
  .resetbtn{
      display: flex;
    align-items: center;
    gap: 3px;
    width:80px;
    padding: 10px 20px 10px;
    box-sizing: border-box;
  }

 footer{
  margin-top: 10px auto;
 }


#feedback{
  width: 80%;
}

}
/* Extra small screens */
/* @media (max-width: 480px) {
  .title { font-size: 22px; }
  #end-screen { font-size: 22px; }
  #end-message { font-size: 18px; }
} */

