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

body {
  background: #0a1208;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  color: #f8f0c8;
}

#yal-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#yal-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 100vw;
  max-height: 100vh;
  background: #285818;
}

#yal-hud {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 10px;
  z-index: 5;
  pointer-events: none;
  text-shadow: 2px 2px 0 #000;
}

#yal-biome {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  padding: 6px 14px;
  border: 3px solid #90ee60;
  background: #2d6818;
  color: #90ee60;
  z-index: 5;
  pointer-events: none;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
}

#yal-hearts { color: #e83030; letter-spacing: 2px; }
#yal-gems { color: #40d060; }
#yal-keys { color: #f0c040; }
#yal-quest { color: #c080ff; font-size: 7px; }

.yal-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(8, 16, 6, 0.92);
  text-align: center;
  padding: 24px;
}

.yal-screen.active { display: flex; }

.yal-credit {
  font-size: 8px;
  color: #80c060;
  letter-spacing: 0.15em;
}

.yal-screen h1 {
  font-size: clamp(14px, 3.5vw, 22px);
  line-height: 1.6;
  color: #f8e878;
  text-shadow: 3px 3px 0 #306018;
}

.yal-screen h2 {
  font-size: clamp(12px, 3vw, 18px);
  color: #f8e878;
}

.yal-tagline, .yal-screen p {
  font-size: clamp(7px, 1.8vw, 9px);
  line-height: 2;
  color: #c8d8a8;
  max-width: 420px;
}

.yal-controls {
  font-size: 7px !important;
  color: #90a870 !important;
}

.yal-controls kbd {
  background: #1a2810;
  border: 1px solid #506830;
  padding: 2px 5px;
  border-radius: 2px;
}

.yal-screen button {
  font-family: inherit;
  font-size: 9px;
  padding: 14px 22px;
  background: #408028;
  color: #f8f0c8;
  border: 3px solid #80c050;
  cursor: pointer;
  box-shadow: 4px 4px 0 #183008;
}

.yal-screen button:hover { background: #509030; }
.yal-screen button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #183008; }

.yal-msg {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  max-width: 90vw;
  padding: 12px 16px;
  font-size: 8px;
  line-height: 1.8;
  background: #102008;
  border: 3px solid #f8f0c8;
  color: #f8f0c8;
  text-align: center;
}

.yal-exit {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 12;
  font-size: 8px;
  color: #90a870;
  text-decoration: none;
}

.yal-exit:hover { color: #f8f0c8; }

.yal-cutscene {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.yal-cutscene[hidden] {
  display: none !important;
}

.yal-cutscene-box {
  cursor: pointer;
  width: min(640px, 96vw);
  padding: 18px 20px 16px;
  background: #102008;
  border: 4px solid #f8f0c8;
  box-shadow: 0 0 24px rgba(248, 232, 120, 0.25);
}

.yal-cutscene-name {
  font-size: 9px;
  color: #f8e878;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.yal-cutscene-text {
  font-size: clamp(7px, 1.8vw, 9px);
  line-height: 2.2;
  color: #e8f0c8;
  min-height: 3.5em;
}

.yal-cutscene-hint {
  font-size: 7px;
  color: #80a060;
  margin-top: 14px;
  text-align: right;
}

.yal-map[hidden] {
  display: none !important;
}

.yal-map {
  position: fixed;
  inset: 0;
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(4, 10, 4, 0.92);
  padding: 20px;
}

.yal-map-title {
  font-size: 8px;
  color: #f8e878;
  text-align: center;
}

.yal-map-grid {
  display: grid;
  grid-template-columns: repeat(10, 42px);
  grid-template-rows: repeat(7, 30px);
  gap: 3px;
  max-width: 96vw;
  overflow-x: auto;
}

.yal-map-cell {
  font-size: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #1a2810;
  border: 2px solid #304020;
  color: #506040;
  padding: 4px;
  line-height: 1.4;
}

.yal-map-cell.is-found {
  color: #c8d8a8;
  border-color: #608040;
  background: #243818;
}

.yal-map-cell.is-hinted {
  color: #809060;
  border-color: #405030;
  background: #1a2010;
  opacity: 0.85;
}

.yal-map-cell.is-unknown {
  color: #283020;
  border-color: #202818;
  background: #101808;
  opacity: 0.45;
}

.yal-map-cell.is-here {
  box-shadow: 0 0 8px #f8e878;
  border-color: #f8e878;
}

.yal-map-cell.is-cursor {
  outline: 2px solid #80c8f8;
  outline-offset: 1px;
}

.yal-map-cell.is-empty {
  opacity: 0.25;
}

.yal-map-close {
  font-family: inherit;
  font-size: 8px;
  padding: 10px 18px;
  background: #408028;
  color: #f8f0c8;
  border: 2px solid #80c050;
  cursor: pointer;
  margin-top: 8px;
}

.yal-map-close:hover {
  background: #509030;
}
