* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: black;
}

#startScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: radial-gradient(circle, #1d4b2d 0%, #07140d 78%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

.startBox {
  width: 90%;
  max-width: 600px;
  padding: 36px;
  background: rgba(0, 0, 0, 0.64);
  border: 1px solid rgba(150, 255, 185, 0.36);
  border-radius: 24px;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.75);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px 0;
  color: #9dffb7;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
}

.startBox h1,
.finishBox h1 {
  margin-top: 0;
  font-size: 38px;
  letter-spacing: 1px;
}

.startBox p,
.finishBox p {
  font-size: 16px;
  line-height: 1.6;
}

.controlsText {
  color: #d7ffd7;
}

button {
  margin-top: 18px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: #7df28b;
  color: #072112;
  font-weight: bold;
  font-size: 17px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  transform: scale(1.05);
  background: #a1ffaa;
}

#overlay {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 320px;
  z-index: 20;
  padding: 14px;
  color: white;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  transition: opacity 0.5s ease, transform 0.5s ease, width 0.5s ease;
}

#overlay.finished {
  opacity: 0.7;
  transform: scale(0.88);
  transform-origin: top left;
  width: 280px;
}

#overlay h2 {
  margin: 0 0 7px 0;
  font-size: 20px;
}

#overlay p {
  margin: 7px 0;
  line-height: 1.35;
  font-size: 13px;
}

#progressBar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
  margin: 9px 0;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #52e866, #d8ff75);
  transition: width 0.35s ease;
}

#messageText {
  font-style: italic;
}

#factText {
  color: #e1ffe7;
  border-left: 3px solid #9dffb7;
  padding-left: 8px;
}

#hintText {
  color: #c9ffd3;
  font-size: 12px;
}

#finishPanel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 360px;
  z-index: 45;
  display: none;
  color: white;
  pointer-events: none;
}

#finishPanel.visible {
  display: block;
}

.finishBox {
  width: 100%;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(160, 255, 190, 0.42);
  border-radius: 18px;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.65);
  text-align: left;
  pointer-events: auto;
}

.finishBox h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.finishBox p {
  font-size: 13px;
}

.finishActions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.finishActions button {
  flex: 1;
  margin-top: 8px;
  padding: 11px 14px;
  font-size: 14px;
}

.secondaryButton {
  background: rgba(255, 255, 255, 0.16);
  color: #dfffe4;
  border: 1px solid rgba(157, 255, 183, 0.35);
}

.secondaryButton:hover {
  background: rgba(157, 255, 183, 0.22);
}


#taskToast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(30px);
  min-width: 320px;
  max-width: 520px;
  z-index: 60;
  padding: 14px 18px;
  color: white;
  background: rgba(5, 20, 12, 0.82);
  border: 1px solid rgba(157, 255, 183, 0.55);
  border-radius: 16px;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  text-align: center;
  backdrop-filter: blur(6px);
}

#taskToast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#taskToast strong {
  display: block;
  margin-bottom: 5px;
  color: #9dffb7;
  font-size: 17px;
}

#taskToast span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: #e9fff0;
}

@media (max-width: 600px) {
  #overlay {
    width: calc(100% - 24px);
    left: 12px;
    top: 12px;
  }

  #overlay.finished {
    width: calc(100% - 24px);
    transform: scale(0.94);
  }

  #finishPanel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  #taskToast {
    left: 12px;
    right: 12px;
    bottom: 22px;
    transform: translateY(30px);
    min-width: 0;
    max-width: none;
  }

  #taskToast.visible {
    transform: translateY(0);
  }

  .startBox,
  .finishBox {
    padding: 24px;
  }

  .startBox h1 {
    font-size: 28px;
  }

  .finishBox h1 {
    font-size: 23px;
  }
}


/* Small visual polish helpers */
#overlay {
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.32);
}

#taskToast {
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.78), 0 0 10px rgba(125, 242, 139, 0.15);
}

.controlsText strong { color: #ffffff; }
