/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: last 4 version
*/

.example {
    display: -ms-grid;
    display: grid;
    -webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    background: -webkit-gradient(linear, left top, left bottom, from(white), to(black));
    background: -o-linear-gradient(top, white, black);
    background: linear-gradient(to bottom, white, black);
}




/* Simple overlay for quiz__body */

/* --------- Global style */

/* CSS HEX */
/* --blue: #0202f5;
--persian-blue: #1915c9;
--bilbao: #177e13;
--mystic: #e8edf1;
--buttercup: #f7a71c;
--river-bed: #475562;
--portage: #817ff4;
--gray-chateau: #9da3ab;
--fall-green: #e7ecbe; */

:root {
    --primary-font: "Inter", sans-serif;
    --secondary-font: "Macondo", cursive;
    --primary-color: #3a2620;
    /* dark brown */
    --secondary-color: #506D1B;
    /* light brown */
    --population-color: #177e13;

    --currency-color: #0202f5;
    /* blue */
    --languages-color: #f7a71c;
    /* light blue */

    --highlight-footer-header-backgroundcolor: #4D4D4D;
}




body {
    background-color: white;
    font-family: "Raleway", sans-serif;
    color: #445361;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


.hidden {
  visibility: hidden; /* Element is invisible but still takes up space */
}

.row.hidden {
  display: none;
}

.visible {
  visibility: visible; /* Element is visible */
}

.transparent {
  opacity: 0.3; /* 30% visible */
}

.opaque {
  opacity: 1; /* fully visible */
}

.visible{
    display:block;
}


.disabled {
  pointer-events: none;  /* No clicks or hovers */
  opacity: 0.5;          /* Optional: make it look disabled */
}

.selected-country {
  font-weight: 700;
  background: rgba(12, 74, 110, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

.answer-option {
  width: 100%;
  margin: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--primary-color, #0c4a6e);
  background: #fff;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.answer-option:hover:not([disabled]) {
  background: rgba(12, 74, 110, 0.1);
}

.answer-option.correct {
  /* Correct answer - Bilbao (#177e13) */
  background: #177e13;
  color: #ffffff;
  border-color: #177e13;
}

.answer-option.incorrect {
  /* Wrong answer - Buttercup (#f7a71c). Use dark text for contrast. */
  background: #f7a71c;
  color: #000000;
  border-color: #f7a71c;
}

.answer-option.selected {
  box-shadow: 0 0 0 2px rgba(12, 74, 110, 0.4);
}

.answer-option[disabled] {
  cursor: not-allowed;
  opacity: 0.8;
}

.feedback {
  min-height: 1.5rem;
  margin-bottom: 0.5rem;
}

.feedback--correct {
  color: #2e7d32;
}

.feedback--incorrect {
  color: #c62828;
}
/* --------- Heading */

.heading {
    text-align: center;
    font-size: 2.5rem;
}

.logo {
    height: 40px;
    padding-right: 5px;
}

/* --------- Game layout */

.game-area {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto; /* fill available space to push footer down */
    background-color: #E6ECF0;
    box-sizing: border-box;
    width: 85%;
    max-width: 830px;
    margin-left: auto;
    margin-right: auto;
    padding: 1%;
}

.question-area {    /*flex container */
    display: flex; 
    width: 80%;
    font-size: 1rem;
    margin: auto;
    padding: 50px 0;
}

/* .question-area span {
    padding: 0 15px;
} */

.left-pane {          /*flex-1 container */
  flex: 1; /* takes 2 parts out of total 3 */
  background-color: #E6ECF0;


  display: flex;
  justify-content:center;
  align-items:center;
  font-weight:bold;
}

.right-pane {        /*flex-2 container */
  flex: 2; /* takes 1 part out of total 3 */
  background-color: #E6ECF0;

  color:white;
  display: flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}

/* Overlay setup */
/*
/* .overlay {     */ /*
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease; /* smooth fade in/out */


/* fade in/out both overlay and its children 
.overlay > 
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.right-pane.show-overlay .overlay {
  opacity: 1;
  pointer-events: auto;
}

.right-pane.show-overlay .overlay > * {
  opacity: 1;
  transform: scale(1);
}

/* Spinner */
/*.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Text styling */
/*
.overlay-text {
  font-size: 1.2rem;
  font-weight: 500;
}


*/



/* -------------------------------------------------------*/






.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column; /* or row */
  gap: 10px;
  max-width: 250px;
}
.country {
  background-color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #ffffff;
  text-align: center;
  cursor: pointer; /* visually indicates clickability */
  transition: background 0.2s, transform 0.1s;
}

.country:hover {
  background-color: #f2f6ff;
  transform: scale(1.02);
}

.item-list.disabled {
  pointer-events: none;   /* blocks clicks, hovers, etc. */
  opacity: 0.5;           /* visually looks disabled */
  user-select: none;      /* prevent text selection */
}


.score-area {
    display:flex;
    margin: 5px auto;
    width: 60%;
    font-size: 1.2rem;
}

.controls-area {
    width: 85%;
    margin: 30px auto;
}

#score {
    color: green;
    font-weight: bold;
}

#incorrect {
    color: red;
    font-weight: bold;
}

.answer-message {
    display: none;
    font-size: 1rem;
}

#answer-box {
    border: none;
    color: #445361;
    display: inline-block;
    height: 40px;
    width: 80px;
    font-size: 1.2rem;
}

.scores {
    display: inline-block;
    padding: 25px;
}

/* --------- Buttons */

.btn {
    width: 220px;
    height: 60px;
    font-family: "Raleway", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: white;
}

.btn:focus {
    outline: none;
}

.btn--big {
    padding-top: 10px;
    border-radius: 50%;
    background-color: white;
    border: 10px solid;
    width: 100px;
    height: 100px;
    font-size: 3.2rem;
    margin: 0 30px;
    transition: all 0.5s;
}

.btn--big::after{
    content: attr(data-type);
    font-size: 1rem;
    color: #445361;
    position: relative;
    left: -0.5em;
}

.btn--blue {
    border-color: blue;
    color: blue;
}

.btn--blue:active,
.btn--blue:hover {
    background-color: darkblue;
    color: white;
}

.btn--orange {
    border-color: orange;
    color: orange;
}

.btn--orange:active,
.btn--orange:hover {
    background-color: darkorange;
    color: white;
}

.btn--red {
    border-color: red;
    color: red;
}

.btn--red:active,
.btn--red:hover {
    background-color: darkred;
    color: white;
}

.btn--green {
    border-color: green;
    color: green;
}

.btn--green:active,
.btn--green:hover {
    background-color: darkgreen;
    color: white;
}

/* Visual selected state for mode buttons (mirror hover/active) */
.btn--green.mode-selected {
  background-color: darkgreen;
  color: white;
}
.btn--blue.mode-selected {
  background-color: darkblue;
  color: white;
}
.btn--orange.mode-selected {
  background-color: darkorange;
  color: white;
}

/* Style the difficulty select so it matches the appearance of the control-area buttons */
#difficulty-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    width: 100px;
    height: 100px;
    padding: 0 0.5rem;
    border-radius: 50%;
    border: 10px solid #445361; /* default border like other controls */
    background-color: white;
    color: inherit;
    font-family: var(--primary-font, "Raleway", sans-serif);
    font-size: 0.9rem; /* slightly smaller so option text fits */
    text-align: center;
    text-align-last: center; /* center the selected option in many browsers */
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Smaller screens: scale the select like the buttons do */
@media (max-width: 425px) {
  #difficulty-select {
    width: 50px;
    height: 50px;
    font-size: 0.7rem;
    padding: 0;
    margin-left: 0.2rem;
  }
}

.btn--gray {
    margin-top: 25px;
    background-color: #445361;
    border: 1px transparent;
    border-radius: 20px;
}

.btn--gray:active,
.btn--gray:hover {
    background-color: #0d1013;
}


.quiz__body{
  display: flex;
  flex-direction: column;
  gap: 1rem; /* spacing between rows */
  max-width: 400px;
  margin: 0 auto;
  align-items: center;

  /* visibility: hidden;   /* start hidden */
  /* opacity: 0; */
  /* transition: opacity 0.3s ease; */ 



}

.quiz__body.show {
  visibility: visible;
  opacity: 1;
}

.row {
  display: flex;
  justify-content: center; /* center items horizontally */
  gap: 1rem; /* spacing between items */
}

/* Row 1: text bold and slightly larger */
.row-1 p {
  font-weight: bold;
  font-size: 1.3rem;
  margin: 0;
  color: #475562;
}

/* Rows 2 & 3: rounded buttons */
.row-2 button,
.row-3 button {
  border-radius: 12px;
  padding: 0.6rem 1rem;
  border: none;
  /* Default / neutral buttons - Persian Blue (#1915c9) */
  background-color: #1915c9;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease; /* smooth hover */
}
/* Hover effect for Row 2 & 3 buttons */
.row-2 button:hover,
.row-3 button:hover {
  background-color: #15116a; /* slightly darker Persian Blue */
  transform: scale(1.05); /* slight grow */
}

/* Row 4: centered dark grey message */
.row-4 p {
  color: #555; /* dark grey */
  text-align: center;
  margin: 0;
  font-size: 1rem;
}

/* p.scores{
    position:fixed;
    bottom:450px;
} */

/* Overlay and message pane using visibility */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  visibility: hidden; /* hidden but stays in flow */
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.overlay.hide {
  visibility: hidden;
  opacity: 0;
}


.overlay.show {
  visibility: visible;
  opacity: 1;
}

.message-pane {
  background: white;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  text-align: center;
  z-index: 11;
}


footer {
    position: static; /* keep footer in normal flow */
    width: 100%;
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
}

/* --------- Media queries */

@media (max-width: 425px) {
  .controls-area {
    width: 100%;
  }

  .btn--big {
    margin: 0 10px;
    padding: 5px;
    border: 5px solid;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .btn--big::after {
    font-size: 0.6rem;
    left: -0.7rem;
  }

  .question-area {
    padding: 10% 0;
    width: 100%;
  }

  .question-area span {
    padding: 0;
  }

  .answer-message {
    display: block;
  }

  #answer-box {
    display: block;
    margin: 0 auto;
  }

  .btn--gray {
    margin-top: 0;
  }

  .score-area {
    width: 100%;
  }

  .scores {
    margin: 0.5em auto;
    display: block;
    padding: 5px;
  }

  .heading {
    font-size: 2rem;
  }

  .question-area .item-list {
    font-size: 0.8rem;
  }

  .question-area .item-list .country {
    font-size: 0.8em;
    padding: 9px 13px;
  }

  .right-pane .quiz__body {
    font-size: 0.8rem;
  }

  .right-pane .quiz__body .answer-option {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    margin: 0.35rem;
  }

  .right-pane .quiz__body #showOverlayBtn {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
    display: block;
    margin: 0.75rem auto 0;
  }

  .left-pane {
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: 0.5rem;
  }
}

@media (max-width: 320px) {
  .game-area {
    min-height: 60vh; /* allow growth without forcing fixed height */
  }

  .right-pane .quiz__body {
    font-size: 0.8rem;
  }

  .right-pane .quiz__body .answer-option {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    margin: 0.35rem;
  }

  .right-pane .quiz__body #showOverlayBtn {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
  }

  .right-pane .quiz__body .row-1 p {
    font-size: 1.04rem;
  }

  .right-pane .quiz__body .row-1 button {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }

  .right-pane .quiz__body .row-4 p {
    font-size: 0.8rem;
  }
}

/* Improved 320px responsiveness: ensure layout stacks and fits without horizontal overflow */
@media (max-width: 320px) {
  /* Use full width and remove side paddings */
  .game-area {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
  }

  /* Stack controls and question area vertically */
  .controls-area {
    width: 100%;
    padding: 6px 0;
  }

  .control-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
  }

  /* Make the big circular buttons much smaller to fit */
  .btn--big {
    width: 60px;
    height: 60px;
    border-width: 6px;
    font-size: 1.6rem;
    margin: 0 6px;
  }

  .btn--big::after { left: -0.4em; }

  /* Difficulty select matches reduced button size */
  #difficulty-select {
    width: 60px;
    height: 60px;
    font-size: 0.65rem;
    border-width: 6px;
    margin-left: 0;
  }

  /* Make the question area stack and shrink padding */
  .question-area {
    flex-direction: column;
    padding: 24px 6px;
    width: 100%;
    box-sizing: border-box;
  }

  .left-pane, .right-pane {
    flex: none;
    width: 100%;
  }

  .item-list {
    max-width: 100%;
    gap: 6px;
  }

  .country {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .quiz__body {
    max-width: 100%;
    padding: 8px;
  }

  .row-2 button, .row-3 button {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  /* Ensure overlay covers correctly on small screens */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  footer { padding: 0.6rem; font-size: 0.85rem; }
}