html, body {
  height: 100%;
  margin: 0;
  background-color: white;
}

body {
    background-color: darkgreen;    
    min-height: 100vh;
    width: 100vw;
    border-style:double;
    border-color:chartreuse ;
    box-sizing: border-box;
}

p, h1, h2, h2, h4 {
  margin-top: 0px;
}

.world-container {
  height: 90vh;
  max-height: 900px;
  display: grid; 
  grid-template-columns: 3fr 1fr;   
  width: 99%;   
  justify-self: center;
}

.gamePlayPanel {  
  display: grid;
  grid-template-rows: minmax(120px, auto) 1fr minmax(90px, auto);
  background-color:dodgerblue; 
}

#game-play-area { 
  display: grid; 
  grid-template-rows: 12% 12% 15% 20% 26% 15%;
  background-color: rgb(130, 190, 250);
  height: 100%;
  width: 99%; 
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2),
              inset -3px -3px 6px rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2);           
  border-radius: 8px;
  margin: auto; 
}

.funFactPanel {
  display:flex;
  flex-direction: row; 
  align-content: center;
  justify-content: left;  
  background-color: rgb(100, 177, 46);
  width: 100%;
  height: 94%;  
  margin-top: 7px; 
}

#fun-fact-lbl {
  margin-right: 5px;
  margin-left: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 25px;
}

#facts {  
  display: flex;
  flex-direction: column; 
  background-color:rgb(120, 162, 78);
  line-height: 1;
  height:78%;
  width: 91%;
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2),
              inset -3px -3px 6px rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2); 
  border-radius: 6px;
  margin-top: 6px; 
}

#lineOne, #lineTwo {
  color: white;
  font-size: 1.2rem;
  margin-left: 40px; 
  margin-top: 10px;
}

.instructions-panel { 
  height: 100%;  
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  background-color:rgb(130, 190, 250);   
}

#instructions-text { 
  background-color: white;
  height: auto;
  overflow-y: auto;
  box-sizing: border-box;
  width: 97%; 
  border-radius: 9px;
  border-color: black;
  border-width: 2px;
  border-style:solid;
  margin-left: 7px; 
  margin-top: 4px; 
  line-height: 1.3; 
}

.title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 8px;
  margin-top: 10px;
}

#text-displayed {
  font-size: 0.8rem;
  text-align: left;
  color: black;
  margin-left: 8px;
}

#smallest {
  font-size: 0.6rem;
  margin-left: 8px;
}

#name-and-score {
  color: yellow;
  margin-bottom: 0px;
  font-size: 1.2rem;
  margin-left: 55px;
}

#name {
  width: 70px;
  height: 26px;
  margin-bottom: 8px;
  margin-right: 10px;
  font-size: 1rem;
}

#hi-score {
  width: 60px;
  height: 26px;
  margin-left: 5px;
  font-size: 1.3rem;
}

#score-area {
  display: flex;
  width: 100%;
  height:100%;
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  margin-left: 3px;
}

#highScoreToDate {
  color: yellow;
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 5px;
  margin-top: 8px;
  margin-left: 15px;
}

#scoreData {
  width: 98%;
  height: 90%;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 1.3rem;
  background-color: dodgerblue;
  justify-content:center;
  align-items: center; 
  border-radius: 8px;
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2),
              inset -3px -3px 6px rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2);   
}

.informationBar {
  height: 89%;
  width: 100%;
  background-color:rgb(100, 177, 46); 
  margin-top: 6px;
  margin-left: 5px;
}

#buttons {
  display: grid;
  grid-template-columns: 25% 25% 50%;
  align-items: center;
  background-color: rgb(120, 162, 78);
  height: 95%;
  width: 96%;
  padding: 0 24px;
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2),
              inset -3px -3px 6px rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
}

#exit-line {
  justify-self: start;
}

#game-number-lbl {
  justify-self: center;
}

#game-points-label {
  justify-self: end;
}

#game-number-lbl {
font-size: 1.5rem;
margin-top:10px;
}

#game-number {
  width: 40px;
  height: 30px;  
  color: red;
  text-align: center;
  font-size:0.9rem;
  font-weight: bold;
  border-style: solid;
  border-color:darkgreen;
  border-width: 2px;
}

#exit-game {
    border-radius: 8px;
    cursor: pointer;
    background-color: darkgreen;      
    text-align: center;
    color: white;  
    width: 140px;
    height: 32px;
}

#game-points-label {
  font-size:2rem;
  font-style: bold;
  font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
  color: black;
  margin-top: 9px;
 
}

#game-points-value {
  width: 80px;
  height: 35px;
  color: red;
  margin-right: 20px;
  font-size: 1.5rem;
  border-style: solid;
  border-color:darkgreen;
  border-width: 2px;
}

#start-line {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#ques-left-lbl {
  font-size: 1.25rem;
  font-weight:bold;
  margin-top: 10px;
}

#ques-left {
  width: 40px;
  height: 30px;
  margin-top:10px;
  margin-right: 100px;
  font-size: 1.5rem;
  color:blue;
}

.question-line {
  display: grid;  
  grid-template-rows: 15% 85%;
}

#player-cue {
  color: white;
  font-size: 0.9rem;
  margin-left: 154px;
}

#question-lbl {
  margin-left: 40px;
  font-size: 1.5rem;
  margin-top: 5px;
  font-weight: bold;
}

#question-input {
  width: 100%;
  max-width: 920px;
  height: 50px;
  margin-top: 5px;
  font-size: 1.2rem;
  font-style:bold;
}

.difficulty-line {
    display: flex;
    align-items: center;  /* vertically center everything */
    width: 100%;
    gap: 10px;
    margin-bottom: 10px;
}

/* Left section */
#difficulty {
    width: 20%;
    display: flex;
    align-items: center;  /* label + input inline */
    gap: 5px;
}

#timer-row {
  display: flex;
  align-items: center;
}

#timerContainer {
    width: 53%;
    height: 30px;
    background-color: #ddd;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-top: 20px;
    margin-left: 153px;
    margin-right: 10px;
}

#timerBar {
    display: flex;
    height: 100%;
    width: 100%;
    background-color: orange;
    transition: width 0.1s linear;
    position: relative;   
}

#countdown-timer-lbl {
    position: absolute;   
    text-align: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    top: 50%;
    margin-left: 20px;
    transform: translateY(-50%);
    pointer-events: none; /* clicks pass through */
}

#time-left-container {     
    align-items: center;  /* label inline with input */
    justify-content: center;
    gap: 5px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    margin-left: 18px;
}

#time-left {
  width: 30px;
  height: 30px;
  text-align: center;
  background-color: white; 
  color:black; 
  font-size: 1rem;
}

.answer-line {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.2fr;
  margin-top: 15px; 
}

#answer-lbl {
  margin-left: 44px;
  font-size: 1.5rem;
  margin-top: 5px;
}

#answer {
  width: 110px;
  height: 40px;
  color: blue;
  margin-left: 4px;
  font-size: 1.2rem;
}

#integers {
  font-size: 0.9rem;
  margin-left: 124px;
  margin-top: 2px;
}

#submit {
  border-radius: 8px;
     cursor: pointer;
     background-color: blue; 
     align-items: center;
     text-align: center;
     color: white;  
     width: 160px;
     height: 40px;
     margin-top: 5px;
     margin-left: 5px;
}

#submit:disabled {
  background-color: grey;
  color: black;
}

#answer-scoreboard {
  background-color: dodgerblue;
  width: 100%;
  max-width: 400px;
  height: 160px;
    border-radius: 8px;
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2),
              inset -3px -3px 6px rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2);     
}

#scoreboard-title {
  color: yellow;
  text-align: center;
  font-size:1.5rem;
  margin-top: 5px;
}

#points-answer {
  font-size: 1rem;
  margin-left: 60px;
  margin-top: 10px;
   margin-bottom: 8px;
  color: white; 
}

#points-input {
  width: 80px;
  height: 20;  
  color:black;
}

#correct-answer-lbl {
  font-size: 1rem;
  margin-left: 75px;
  margin-top: 3px;
   margin-bottom: 8px;
  color: white;
}

#correct-answer {
  width: 80px;
  height: 20;
  margin-top: 5px; 
  color:black;
}

#offset-lbl {
   font-size: 1rem;
   margin-left: 137px;
    margin-top: 5px;
    color: white;
}

#offset-box {
  width: 80px;     /* wider */
  height: 18px; 
  margin-top: 3px;   /* add missing 'px' units */ 
  color: black;
}

#start-line {
  display: flex;
  flex-direction: row;
}

#start-game {
   border-radius: 8px;
     cursor: pointer;
     background-color: blue; 
     align-items: center;
     text-align: center;
     color: white;  
     width: 240px;
     height: 36px;
     margin-top: 15px;
     margin-left: 40px;
}

#music-toggle {
     border-radius: 8px;
     cursor: pointer;
     background-color: darkgreen; 
     align-items: center;
     text-align: center;
     color: white;  
     width: 240px;
     height: 36px;
     margin-top: 0px;
     margin-left: 40px;
}

#difficulty {
  margin-left: 40px;
  margin-top: 15px;
  margin-right: 8px;
  font-weight:bold;
  font-size: 1.2rem;
}

#yes-no {
  width: 50px;
  height: 30px;
  margin-left: 5px;
  text-align: center;
  font-size: 1.5rem;
}

.label {
 font-size: 1.3rem;
 font-weight: bold;
 white-space: nowrap;
 margin-left: 15px;
}

#resultsDialog {
  position: fixed;
  inset: 0;          /* disables the browser's built-in centering */
  margin: auto;      /* allows custom transform to work */
  background-color: white;  
  width: 300px;
  height: 180px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);  
  transform: translate(-20%, -80%); /* now works */
  top: 50%;
  left: 50%;
}

#resultsDialog::backdrop {
  background: rgba(0,0,0,0.5);  /* optional dimming effect */
}

#message {
  font-size: 1.2rem;
  color: blue;
}

#results-button {
  border-radius: 6px;
     cursor: pointer;
     background-color: darkgreen; 
     align-items: center;
     text-align: center;
     color: white;  
     width: 60px;
     height: 30px;
     margin-top: 25px;     
}

#gameOverDialog {
  /* Force it to act like a fixed modal centered in the viewport */
  position: absolute !important;
  inset: 0 !important;           /* top:0; right:0; bottom:0; left:0; */
  width: 400px !important;
  height: 320px !important;
  margin: auto !important;       /* centers within the inset box */
  transform: none !important;    /* remove any previous transforms */
  z-index: 2147483647 !important;/* very high to beat anything */
  background-color: rgb(23,131,203) !important;
  color: white !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}

/* Optional: visible backdrop so you see overlay */
dialog::backdrop { 
  background: rgba(0,0,0,0.45) !important;
}

#hiScoreDialog {
   position: absolute !important;
  inset: 0 !important;           /* top:0; right:0; bottom:0; left:0; */
  width: 300px !important;
  height: 280px !important;
  margin: auto !important;       /* centers within the inset box */
  transform: none !important;    /* remove any previous transforms */
  z-index: 2147483647 !important;/* very high to beat anything */
  background-color: rgb(23,131,203) !important;
  color: white !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}


#exit-gameOver {
  border-radius: 8px;
     cursor: pointer;
     background-color: darkgreen; 
     align-items: center;
     text-align: center;
     color: white;  
     width: 140px;
     height: 32px;
     margin-top: 25px;
}

#playBTN {
   border-radius: 8px;
     cursor: pointer;
     background-color: rgb(32, 0, 100); 
     align-items: center;
     text-align: center;
     color: white;  
     width: 140px;
     height: 32px;
     margin-top: 23px;
}



#OkBtn {
  border-radius: 6px;
     cursor: pointer;
     background-color: rgb(32, 0, 100); 
     align-items: center;
     text-align: center;
     color: white;  
     width: 60px;
     height: 30px;
     margin-top: 12px;
}

/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s;
  border: 2px solid red;
}
