header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 30px;
    background: rgba(22, 33, 62, 0.95);
    color: #e94560;
    font-family: 'Segoe UI', sans-serif;
    font-size: 75px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

header img {
    width: 150px;
    height: auto;
    animation: logo-animation 2s infinite;
}

@keyframes logo-animation {
  from{opacity: 0};
  to{opacity: 1};
}

header span:hover {
    color: #fff;
    cursor: pointer;
    transition: color 0.2s;
}

#game-container {
    margin-top: 120px;
    background: #16213e;
    border-radius: 16px;
    align-items: center;
    padding: 40px;
    width: 1150px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);

    position: relative;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(8px);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
}

h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

.big-btn:active, .answer-btn:active, #category-screen button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

#start-screen, #custom-questions-screen, #category-screen, #question-screen, #end-screen {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#start-screen.hide, #custom-questions-screen.hide, #category-screen.hide, #question-screen.hide, #end-screen.hide {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 30px;
    background: rgba(22, 33, 62, 0.95);
    color: #e94560;
    font-family: 'Segoe UI', sans-serif;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

img {
  max-width: 100%;
  height: auto;
  width: 200px;
  padding: 20px;
  padding-top: 30px;
  padding-right: 50px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', sans-serif;
  color: #eee;
  display: flex;
  justify-content: center;
  flex-direction: column; 
  align-items: center;
  min-height: 100vh;

  background-image: url('ocean-backdrop.jpg');
  background-size: cover;     
  background-position: center;
  background-repeat: no-repeat;  
  background-attachment: fixed;
}

.category-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#start-screen {
  text-align: center;
  display: block;
}

#start-screen h1 {
  font-size: 2.5rem;
  color: #e94560;
  margin-bottom: 12px;
}

#start-screen p {
  color: #aaa;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

#difficulty-screen {
  text-align: center;
  display: none;
}

#difficulty-screen h1 {
  font-size: 2.5rem;
  color: #e94560;
  margin-bottom: 12px;
}

#difficulty-screen p {
  color: #aaa;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

#custom-questions-screen {
  text-align: center;
  display: none;
}

#custom-questions-screen h1 {
  font-size: 2.5rem;
  color: #e94560;
  margin-bottom: 12px;
}

#custom-questions-screen p {
  color: #aaa;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

#custom-questions-screen input {
  background: #0f3460;
  border: 2px solid #1a4a8a;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  padding: 12px 16px;
  width: 100%;
  transition: border-color 0.2s ease;
  align-items: left;
}

#custom-questions-screen input:focus {
  outline: none;
  border-color: #e94560;
}

#custom-questions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

#custom-answers {
  margin: 10px auto;
  padding: 10px;
  width: 80%;
  border-radius: 8px;
  border: 1px solid #0f3460;
}

#category-screen {
  display: none;
  text-align: center;
  gap: 20px;
  flex-direction: column;
}

#category-screen h1 {
  font-size: 2.5rem;
  color: #e94560;
  margin-bottom: 12px;
}

#category-screen button {
  background: #0f3460;
  border: 2px solid #1a4a8a;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 14px 30px;
  transition: all 0.2s ease;
}

#category-screen button:hover {
  background: #1a4a8a;
  border-color: #e94560;
}

.category-buttons-scrollable {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

#question-screen {
  display: none;
}

#end-screen {
  display: none;
  text-align: center;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#end-screen .big-btn {
  margin-top: 0;
}

.answer-btn, .big-btn, #category-screen button {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.answer-btn:hover, .big-btn:hover, #category-screen button:hover {
  transform: scale(1.05);
}

#restart-btn {
  display: flex;
  gap: 10px;
}

.progress-bar-container {
  background: #0f3460;
  border-radius: 10px;
  height: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  background: #e94560;
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 10px;
}
#question-counter {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
#question-text {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
  color: #fff;
}
#answer-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.answer-btn {
  background: #0f3460;
  border: 2px solid #1a4a8a;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 14px 20px;
  text-align: left;
  transition: all 0.2s ease;
}
.answer-btn:hover {
  background: #1a4a8a;
  border-color: #e94560;
}
.answer-btn.correct {
  background: #1a6b3c;
  border-color: #2ecc71;
}
.answer-btn.incorrect {
  background: #6b1a1a;
  border-color: #e74c3c;
}
#feedback-text {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 600;
  min-height: 24px;
  color: #2ecc71;
}

#score-display {
  font-size: 1rem;
  color: #aaa;
  margin-top: 20px;
  text-align: right;
}

#score-display span {
  color: #e94560;
  font-weight: bold;
}

.big-btn {
  background: #e94560;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 40px;
  transition: background 0.2s ease;
  margin-top: 16px;
}

.big-btn:hover {
  background: #c73652;
}

#end-screen h2 {
  font-size: 2rem;
  color: #e94560;
  margin-bottom: 12px;
}

#final-score-text {
  font-size: 1.3rem;
  color: #aaa;
  margin-bottom: 8px;
}

#end-message {
  font-size: 1rem;
  color: #888;
  margin-bottom: 24px;
}

#timer-display {
  font-size: 1.5rem;
  font-weight: bold;
  color: #e94560;
  text-align: right;
  margin-bottom: 10px;
  min-height: 36px;
}

.hidden-feature {
  display: none;
  color: #50C878;
}

/* Mobile Responsive Overrides */
@media (max-width: 1200px) {
    #game-container {
        width: 95%;          /* Let the container shrink to the screen width */
        margin-top: 180px;   /* Extra space because header text wraps */
        padding: 20px;       /* Smaller padding for more content room */
    }

    header {
        font-size: 32px;     /* Smaller title so it doesn't overflow */
        flex-direction: column; /* Stack logo and text vertically */
        gap: 5px;
        padding: 10px;
    }

    header img {
        width: 80px;         /* Smaller logo for mobile */
    }

    footer {
        font-size: 14px;     /* Smaller footer text */
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;   /* Scale down headings */
    }

    #question-text {
        font-size: 1.1rem;   /* Ensure questions are readable but fit */
    }

    .category-buttons-container {
        flex-wrap: wrap;     /* Allow buttons to wrap to next line */
    }
}