@font-face {
  font-family: "Barlow";
  src: url("../../assets/fonts/barlow/Barlow-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "Barlow";
  src: url("../../assets/fonts/barlow/Barlow-Bold.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "Barlow";
  src: url("../../assets/fonts/barlow/Barlow-Black.ttf") format("truetype");
  font-weight: 900;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1209;
  font-family: "Barlow", Arial, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 1920px;
  max-height: 1080px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-canvas {
  display: block;
  image-rendering: auto;
}

.hidden {
  display: none !important;
}

/* --- Overlay screens --- */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* --- Main Menu --- */
#screen-main-menu {
  background: url("../../assets/textures/ui/Start_with_Title.png") center/cover no-repeat;
}

#screen-main-menu .menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

#btn-start {
  position: absolute;
  bottom: 28%;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: transform 0.1s;
}

#btn-start img {
  width: 350px;
  height: auto;
}

#btn-start:hover img {
  content: url("../../assets/textures/ui/Startbutton_Hover.png");
}

#btn-start:hover {
  transform: translateX(-50%) scale(1.03);
}

.credits-text {
  position: absolute;
  bottom: 8%;
  left: 10%;
  color: #2e1f13;
  font-size: 18px;
  font-weight: 700;
  max-width: 350px;
  text-align: center;
}

/* --- HUD / Playing --- */
#screen-playing {
  pointer-events: none;
  z-index: 5;
}

#screen-playing > * {
  pointer-events: auto;
}

#btn-encyclopedia {
  position: absolute;
  bottom: 20px;
  right: 20px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

#btn-encyclopedia img {
  width: 140px;
  height: auto;
}

#btn-encyclopedia:hover img {
  content: url("../../assets/textures/ui/Toolbar_Encyclopedia_Hover.png");
}

#stroke-hint {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
}

/* --- Level Complete --- */
#screen-level-complete {
  background: url("../../assets/textures/ui/Esc_Menue_Background.png") center/cover no-repeat;
}

.lc-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 60px;
  max-width: 800px;
  width: 90%;
}

.lc-fossil-display {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.lc-text {
  color: #2e1f13;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.lc-fun-fact {
  color: #1a0f08;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  max-width: 700px;
  line-height: 1.6;
}

.lc-text-small {
  color: #5a3d22;
  font-size: 20px;
  text-align: center;
}

.lc-stars {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.star-icon-large {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.lc-buttons {
  display: flex;
  gap: 30px;
  margin-top: 10px;
}

.btn-image {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: transform 0.1s;
}

.btn-image:hover {
  transform: scale(1.05);
}

.btn-image img {
  height: 80px;
  width: auto;
}

#btn-replay:hover img {
  content: url("../../assets/textures/ui/Arrow_Repeat_Hover.png");
}

#btn-next-level:hover img {
  content: url("../../assets/textures/ui/Arrow_Next_Hover.png");
}

/* --- Level Select --- */
#screen-level-select {
  background: url("../../assets/textures/ui/Fin_Background.png") center/cover no-repeat;
}

.ls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 85%;
  max-width: 1400px;
  height: 80%;
  position: relative;
}

#btn-level-select-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

#btn-level-select-close img {
  width: 80px;
  height: auto;
}

#btn-level-select-close:hover img {
  content: url("../../assets/textures/ui/Exitbutton_Hover.png");
}

#level-select-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px 30px;
  padding: 60px 40px;
  width: 100%;
  justify-items: center;
  align-items: start;
}

.level-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: default;
  transition: transform 0.15s;
}

.level-entry.played {
  cursor: pointer;
}

.level-entry.played:hover {
  transform: scale(1.08);
}

.level-thumb {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.level-stars {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.star-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* --- Game Over (all levels complete) --- */
#screen-game-over {
  background: url("../../assets/textures/ui/end_screen_no_text.png") center/cover no-repeat;
}

.go-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 40px;
}

.go-text {
  color: #2e1f13;
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  max-width: 600px;
}

#btn-continue-end {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: transform 0.1s;
}

#btn-continue-end img {
  width: 300px;
  height: auto;
}

#btn-continue-end:hover img {
  content: url("../../assets/textures/ui/Continuebutton_Hover.png");
}

#btn-continue-end:hover {
  transform: scale(1.03);
}
