body { 
    margin: 0; 
    font-family: system-ui, sans-serif; 
    color:#111; }

.center { 
    min-height: 100svh; 
    display: grid; 
    place-items: center; 
    background:#ffffff; }

h1 { 
    margin:.2rem 0 .6rem; 
    font-size:clamp(20px,4vw,28px); }

p { color:#444; }

.button { 
    display:inline-block; 
    padding:8px 14px; 
    border-radius:0px; 
    text-decoration:none; 
    font-weight:600; 
    cursor:pointer; 
}
.button.secondary { 
    background:#fff; 
    color:#111; 
    border:2px solid #111; 
}
.topbar { 
    display:flex; 
    align-items:center; 
    gap:12px; 
    padding:10px 14px; 
    border-bottom:1px solid #ddd; 
    background:#fff; 
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10;
}
    


.link { 
    text-decoration:none; 
    color:#111; 
}

.map {
  position: relative;
  width: 900px; height: 650px;
  margin: 20px auto;
  background: #fff; 
}

.spot {
  position:absolute;
  width:70px;
  height:70px;
  cursor:pointer;
}

.popup, .settings-popup {
  position:fixed; 
  top:50%; 
  left:50%; 
  transform:translate(-50%,-50%);
  background:#fff; 
  border:2px solid #111; 
  border-radius:0px; 
  padding:16px 20px;
  box-shadow:0 10px 20px rgba(0,0,0,.2);
  z-index:100;
}

.hidden {
  display: none;
}

#settingsButton {
  background: none;   
  border: none;       
  padding: 0;       
  cursor: pointer;
}

#settingsButton img {
  width: 60px;
  height: 60px;    
  display: block; 
}

.settings-popup { 
    width:300px; 
}

.settings-header { 
    background:#eee; 
    padding:8px 12px; 
    font-weight:bold; 
    margin:-16px -20px 12px -20px; 
    border-bottom:2px solid #111; 
}

.dialog-box {
  border: 2px solid #111;
  border-radius: 0px;
  padding: 10px 12px;        
  background: transparent;     
  max-width: 420px;
  margin: 0 auto;             
  min-height: 56px;           
  display: flex;
  align-items: center;         
}

.dialog {
  margin: 0;                
  font-size: 1rem;
  line-height: 1.4;          
  white-space: pre-wrap;
}

.cursor {
  display: inline-block;
  width: 0.5ch;
  animation: blink 1s steps(1, end) infinite;
}

.hint {
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 10px auto 6px;     
  text-align: center;
  max-width: 420px;
}

#startBtn {
  margin: 6px auto 0;          
  display: inline-block;
}

#startBtn.hidden { display: none; }

.card {
  text-align: center;
  background: #fff;
  margin: 40px auto;
  padding: 40px 24px;          
  max-width: 520px;            
}

.icon-btn { background:none; border:none; padding:0; cursor:pointer; }
.icon-btn img { width:40px; height:40px; display:block; }

.progress {
  position: relative;
  height: 12px;
  min-width: 160px;
  background: #eee;
  border: 1px solid #111;
  border-radius: 999px;
  overflow: hidden;
  margin-right: 10px;
}


.viewport {
  position: fixed;
  left: 0; right: 0;
  top: 60px;                 
  bottom: 0;
  width: 100vw;
  height: calc(100svh - 60px);
  margin: 0;
  border: none;              
  border-radius: 0;
  overflow: hidden;
}

.world {
  position: absolute;
  width: 2200px;   
  height: 1400px;
  transform: translate(0,0);
}
.map-image {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: cover;
  image-rendering: pixelated;
}


.player {
  position:absolute;
  width:40px; height:40px;
  transform: translate(-50%, -50%);
}
#playerSprite {
  width:100%; height:100%;
  display:block;
  image-rendering: pixelated;
}

.spot {
  position:absolute;
  width:60px; height:60px;
  transform: translate(-50%, -50%);
}
.spot.discovered { outline:2px solid #ffd166; box-shadow:0 0 0 6px rgba(255,209,102,0.2); border-radius:50%; }

.hud {
  position: absolute;
  inset: auto 12px 12px auto; 
  z-index: 5;
  pointer-events: none;        
}

.hud.left { inset: auto auto 12px 12px; }


.hud-card {
  pointer-events: auto;          
  background: rgba(255,255,255,0.92);
  border: 2px solid #111;
  border-radius: 0;
  padding: 8px 10px;
  box-shadow: 0 6px 12px rgba(0,0,0,.15);
  min-width: 180px;
}

.progress {
  position: relative;
  height: 14px;
  background: #eee;
  border: 1px solid #111;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #ffd166, #9aff8a); }
.progress-label {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #111; mix-blend-mode: multiply;
}

@media (max-width: 640px) {
  .hud-card { min-width: 140px; padding: 6px 8px; }
}
