html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #0b0f26;
  color: #d9e6ff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

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

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 4px solid #4ea4ff;
  box-shadow: 0 0 24px rgba(0,0,0,0.6), 0 0 80px rgba(60,140,255,0.3) inset;
  background: #102a6b;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
}

/* iPhone 16 Pro Max specific optimizations */
@media screen and (max-width: 430px) and (max-height: 932px) {
  #game {
    width: 100vw;
    height: auto;
    border-width: 2px;
  }
  
  #title h1 { 
    font-size: 48px; 
  }
  
  .controls p { 
    font-size: 12px; 
    margin: 2px 0;
  }
  
  #help { 
    font-size: 12px; 
  }
}

/* General mobile optimizations */
@media screen and (max-width: 768px) {
  #game {
    width: 100vw;
    height: auto;
    border-width: 2px;
  }
  
  #title h1 { 
    font-size: 44px; 
    letter-spacing: 2px;
  }
  
  #title .byline { 
    font-size: 14px;
  }
  
  .controls p { 
    font-size: 13px; 
    margin: 2px 0;
  }
  
  #help { 
    font-size: 13px; 
    margin-bottom: 5px;
  }
  
  #help ul {
    margin: 0 5px 8px 5px;
  }
  
  #startBtn {
    padding: 12px 20px;
    font-size: 16px;
    margin: 8px auto 0 auto;
  }
}

/* Landscape mobile optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
  #title h1 { 
    font-size: 32px; 
    margin: 4px 0 0 0;
  }
  
  #title .byline { 
    font-size: 12px;
    margin: 3px 0 6px 0;
  }
  
  .controls p { 
    font-size: 11px; 
    margin: 1px 0;
  }
  
  #help { 
    font-size: 11px; 
    margin-bottom: 5px;
  }
  
  #help ul {
    margin: 0 5px 5px 5px;
  }
  
  #startBtn {
    padding: 8px 16px;
    font-size: 14px;
    margin: 4px auto 0 auto;
  }
}

#overlay {
  position: absolute; 
  inset: 0; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: space-between; 
  pointer-events: none;
}

#title { 
  pointer-events: auto; 
  margin-top: 16px; 
  text-align: center; 
}

#title h1 { 
  font-size: 64px; 
  letter-spacing: 4px; 
  margin: 8px 0 0 0; 
  color: #9fd3ff; 
  text-shadow: 0 2px 0 #06204f, 0 0 14px rgba(180,220,255,.25); 
}

#title .byline { 
  margin: 6px 0 12px 0; 
  color: #b6ccff; 
  opacity: .9; 
}

.controls p { 
  margin: 4px 0; 
}

#help { 
  pointer-events: none; 
  margin-bottom: 10px; 
  font-size: 14px; 
  opacity: .9; 
}

#help ul {
  list-style: none; 
  padding-left: 0; 
  margin: 0 10px 12px 10px;
}

#help li {
  margin: 3px 0;
}

#startBtn {
  pointer-events: auto;
  margin: 10px auto 0 auto;
  padding: 10px 18px;
  background: #164e98;
  color: #d9e6ff;
  border: 2px solid #66aaff;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  -webkit-user-select: none;
  user-select: none;
}

#startBtn:hover { 
  background: #1a63c4; 
}

#startBtn:active { 
  background: #1a63c4; 
  transform: scale(0.98);
}

#hi {
  pointer-events: none; 
  margin-bottom: 10px;
}

.hiscore {
  font-size: 14px; 
  color: #9fd3ff; 
  text-align: center;
}

/* legend colors */
.crumb{color:#ffd281}
.ant{color:#ff9c9c}
.grease{color:#c2ff8c}
.eyes{color:#e3f2ff}
.mouth{color:#fff}
.brush,.sponge{color:#ffef86}
.razor{color:#f8a6a6}
.drain{color:#a6f4ff}
.green{color:#7effa1}
.red{color:#ff7676}
.broom{color:#f6e27a}
.roach{color:#b16b44}
EOF < /dev/null
