* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #1b140d;
  font-family: 'Press Start 2P', monospace;
  color: #f2e6cf;
}

#game-root { position: fixed; inset: 0; touch-action: none; }
#game-root canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(to bottom, rgba(20,14,8,0.88), rgba(20,14,8,0));
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }

#title { font-size: 14px; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.pill {
  font-size: 8px; background: #d4a24a; color: #3a2408; padding: 4px 6px;
  border-radius: 2px; text-shadow: none; border: 2px solid #7a5a1f;
}

#scenery-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#scenery-picker .label { font-size: 8px; opacity: 0.75; margin-right: 2px; }
.theme-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  background: #4a2f1a;
  color: #f2e6cf;
  border: 2px solid #2a1a0d;
  border-bottom: 3px solid #2a1a0d;
  padding: 7px 8px;
  cursor: pointer;
  border-radius: 2px;
}
.theme-btn:hover { background: #5c3d22; }
.theme-btn.active { background: #d4a24a; color: #3a2408; border-color: #7a5a1f; }

#hint {
  position: fixed; bottom: 10px; left: 0; right: 0; z-index: 10;
  text-align: center; font-size: 8px; color: #f2e6cf; opacity: 0.85;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  padding: 0 10px;
}

#issue-panel {
  position: fixed; right: 12px; top: 70px; z-index: 20;
  width: min(340px, calc(100vw - 24px));
  max-height: 65vh; overflow-y: auto;
  background: #f2e6cf; color: #3a2810; border: 3px solid #4a2f1a; border-radius: 3px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
  font-size: 10px; line-height: 1.6;
}
#issue-panel.hidden { display: none; }
#issue-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px; background: #d4a24a; color: #3a2408;
  border-bottom: 3px solid #4a2f1a;
}
#issue-panel-close { background: none; border: none; color: #3a2408; font-size: 12px; cursor: pointer; }
#issue-panel-body { padding: 12px; }
#issue-panel-body .repo-desc { opacity: 0.75; margin-bottom: 10px; font-size: 9px; }
#issue-panel-body .issue-row {
  display: flex; gap: 8px; padding: 8px 0; border-top: 1px dashed #b89a6a;
}
#issue-panel-body .issue-row:first-child { border-top: none; }
#issue-panel-body .issue-avatar { width: 20px; height: 20px; image-rendering: pixelated; flex: none; margin-top: 2px; border: 1px solid #4a2f1a; }
#issue-panel-body a { color: #7a3f14; text-decoration: none; font-weight: bold; }
#issue-panel-body a:hover { text-decoration: underline; }
#issue-panel-body .issue-meta { opacity: 0.65; font-size: 8px; margin-top: 4px; }
#issue-panel-body .all-clear { text-align: center; padding: 16px 0; opacity: 0.85; }

@media (max-width: 640px) {
  #title { font-size: 10px; }
  .theme-btn { font-size: 8px; padding: 6px; }
  #hint { font-size: 7px; }
}

@media (max-width: 420px) {
  #topbar { padding: 8px; }
  #title { font-size: 9px; gap: 6px; }
  .pill { font-size: 7px; }
  .theme-btn { padding: 6px 5px; font-size: 7px; }
  #scenery-picker .label { display: none; }
}
